Skip to content

TST: Daily cron with pandas fails with AttributeError: 'SoupStrainer' object has no attribute 'name' #16251

Closed

Description

@pllim

Example log: https://github.com/astropy/astropy/actions/runs/8476606825/job/23226375475

pandas 2.2.1 was release back in Feb 23, so not sure why I didn't see this earlier.

pandas==2.2.1
...
_________________________ test_read_write_format[html] _________________________
...
    def _parse_tables(self, document, match, attrs):
>       element_name = self._strainer.name
E       AttributeError: 'SoupStrainer' object has no attribute 'name'

pandas/io/html.py:601: AttributeError

Activity

  1. neutrinoceros commented on Mar 30, 2024

    @neutrinoceros
    Contributor

    I took a look, and pandas doesn't seem to be the culprit.
    Rather, the breaking change appears to be in beautifulsoup4 4.13.0b2, released on March the 20th
    Further inspection is needed to assess what to do, but this is where I got so far.

  2. neutrinoceros commented on Mar 30, 2024

    @neutrinoceros
    Contributor

    I couldn't find release notes for this beta release, or a changelog, or an existing report at pandas. I'll try to extract a minimal reproducer and report to pandas devs.

  3. neutrinoceros commented on Mar 30, 2024

    @neutrinoceros
    Contributor

    reported upstream at pandas-dev/pandas#58086

  4. pllim commented on Mar 31, 2024

    @pllim
    MemberAuthor

    Thanks for investigating!

  5. neutrinoceros commented on Apr 1, 2024

    @neutrinoceros
    Contributor

    The fix seemed simple enough so I also opened a PR upstream pandas-dev/pandas#58100

  6. neutrinoceros commented on Apr 1, 2024

    @neutrinoceros
    Contributor

    My fix was just merged. However, we're not pulling in pandas nighties, so it might take a while before CI goes back to green by itself. I think we have three options:

    • do nothing and wait it out (might be a while)
    • (temporarily) pin beautifulsoup4
    • pull pandas nightlies

    What would you advise ?

  7. pllim commented on Apr 1, 2024

    @pllim
    MemberAuthor

    That job is for pre-release. Is pandas going to release that fix soon? We can wait a few weeks. If not, then maybe we can check for conflicting pandas + bs4 versions and then xfail it for that combo.

  8. neutrinoceros commented on Apr 1, 2024

    @neutrinoceros
    Contributor

    Apparently the next release should be pandas 3.0, and was due today, so I guess it should come out sometimes soon, at least in a pre-release, which would work for this job.

  9. pllim commented on Apr 1, 2024

    @pllim
    MemberAuthor

    OK let's wait a bit then. Thanks!

  10. neutrinoceros commented on Apr 3, 2024

    @neutrinoceros
    Contributor

    The fix is now backported to pandas 2.2.x, which means it should be available sooner !

  11. neutrinoceros commented on Apr 11, 2024

    @neutrinoceros
    Contributor

    @pllim pandas 2.2.2 is out with the fix + numpy 2 compat, and daily cron is green again ! I think we can close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions