Skip to content
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

Fix DataFrame.applymap has been deprecated warning #55

Closed
trymzet opened this issue Oct 7, 2023 · 5 comments
Closed

Fix DataFrame.applymap has been deprecated warning #55

trymzet opened this issue Oct 7, 2023 · 5 comments

Comments

@trymzet
Copy link

trymzet commented Oct 7, 2023

This is caused by this line in mkdocs_table_reader_plugin/markdown.py.

@timvink
Copy link
Owner

timvink commented Oct 7, 2023

Thanks for mentioning. I don't want to force users to the lastest version of pandas though..

@timvink
Copy link
Owner

timvink commented Oct 7, 2023

Related #54

@trymzet
Copy link
Author

trymzet commented Oct 7, 2023

Understandable, but maybe you can add a version check?

if pd.__version__.startswith("2"):
    df = df.map(lambda s: replace_unescaped_pipes(s) if isinstance(s, str) else s)
else:
    df = df.applymap(lambda s: replace_unescaped_pipes(s) if isinstance(s, str) else s)

@timvink
Copy link
Owner

timvink commented Oct 11, 2023

Yeah that's a good solution. Normally I wouldn't worry about these kinds of warnings, but some people run mkdocs using --strict mode

@timvink
Copy link
Owner

timvink commented Oct 11, 2023

Just released v2.0.2 with this change!

Thanks for pushing this :)

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