Skip to content

Commit

Permalink
Fix the generation of the "multiindex" polars df
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Aug 10, 2024
1 parent dfe261c commit ec67fff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
ITables ChangeLog
=================

2.1.5-dev (2024-08-??)
------------------

**Fixed**
- We have adjusted the generation of the Polars sample dataframes to fix the CI ([Polars-18130](https://github.com/pola-rs/polars/issues/18130))


2.1.4 (2024-07-03)
------------------

Expand Down
10 changes: 8 additions & 2 deletions src/itables/sample_dfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,15 @@ def get_dict_of_test_dfs(N=100, M=100, polars=False):
import pyarrow as pa

polars_dfs = {}
for key in test_dfs:
for key, df in test_dfs.items():
if key == "multiindex":
# Since Polars 1.2, pl.from_pandas fails with this error:
# ValueError: Pandas dataframe contains non-unique indices and/or column names.
# Polars dataframes require unique string names for columns.
# See https://github.com/pola-rs/polars/issues/18130
df.index = df.index.tolist()
try:
polars_dfs[key] = pl.from_pandas(test_dfs[key])
polars_dfs[key] = pl.from_pandas(df)
except (pa.ArrowInvalid, ValueError):
pass
return polars_dfs
Expand Down

0 comments on commit ec67fff

Please sign in to comment.