Skip to content

Commit

Permalink
Fix regression, df.map only available with pd>=2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
timvink authored Oct 11, 2023
1 parent 7267d81 commit 90a4e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mkdocs_table_reader_plugin/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def convert_to_md_table(df: pd.DataFrame, markdown_kwargs: Dict) -> str:

# Avoid deprecated applymap warning on pandas>=2.0
# See https://github.com/timvink/mkdocs-table-reader-plugin/issues/55
if pd.__version__.startswith("2"):
if pd.__version__ >= "2.1.0":
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)
Expand Down

0 comments on commit 90a4e38

Please sign in to comment.