Skip to content

Commit

Permalink
make pd.set_option("future.no_silent_downcasting", True) conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Nov 7, 2024
1 parent d910f75 commit 86fe579
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sssom/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def from_mapping_set_document(cls, doc: MappingSetDocument) -> "MappingSetDataFr

# ! This will break when pandas >= 3.0.0 is released
# https://github.com/pandas-dev/pandas/issues/57734
pd.set_option("future.no_silent_downcasting", True)
if "future.no_silent_downcasting" in pd.options:
pd.set_option("future.no_silent_downcasting", True)
df.replace("", np.nan, inplace=True)
df.dropna(axis=1, how="all", inplace=True) # remove columns with all row = 'None'-s.

Expand Down

0 comments on commit 86fe579

Please sign in to comment.