Skip to content

converter - matplotlib_table.py - condition at row 147 - The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MichalRIcar opened this issue Aug 29, 2024 · 1 comment

Comments

@MichalRIcar
Copy link

MichalRIcar commented Aug 29, 2024

Hi,

I have encountered a future warning using matplot, e.g. dfi.export(d, table_conversion='matplotlib').

The warning: "The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead."

I've tracked down the issue and it is coming from the matplotlib_table.py, row 147 in the converter folder, specifically the orig. condition

        if not thead and not tbody:
            for row in tree.findall(".//tr"):
                rows.append(parse_row(row))

as lxml etree object (thead) recommending - once I've changed the condition to :

        if not len(thead) and not len(tbody):
            for row in tree.findall(".//tr"):
                rows.append(parse_row(row))

the warning is gone and export works as expected.

PaleNeutron added a commit that referenced this issue Aug 30, 2024
@PaleNeutron
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants