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

Get rid of warning "Downcasting behavior in replace is deprecated and will be removed in a future version." #491

Closed
matentzn opened this issue Feb 2, 2024 · 0 comments · Fixed by #492
Assignees

Comments

@matentzn
Copy link
Collaborator

matentzn commented Feb 2, 2024

/usr/local/lib/python3.10/dist-packages/sssom/util.py:156: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.se
t_option('future.no_silent_downcasting', True)`

clutters all log files massively now; Would be good to adress this correctly (not just suppressing the warning)

hrshdhgd added a commit that referenced this issue Feb 8, 2024
…pare for later versions of `pandas` (#492)

Fixes #491  

- [x] Updated using `importlib_resource` instead of `pkg_resources`
   - Reason: `pkg_resources` is going to be deprecated.

- [x] Refactor `pandas` related code to smoothly transition to future
versions and handle deprecation warnings.
- [Pandas
PR](https://github.com/pandas-dev/pandas/pull/54710/files#diff-55001624a0932c1b6cee2e6ddb65dea85c1faf0dee84812c0ca0c32916a71438):
  ```
"Downcasting behavior in `replace` is deprecated and "
"will be removed in a future version. To retain the old "
                             "behavior, explicitly call "
                             "`result.infer_objects(copy=False)`. "
                             "To opt-in to the future "
                             "behavior, set "
"`pd.set_option('future.no_silent_downcasting', True)`",
  ```
  - `A value is trying to be set on a copy of a slice from a DataFrame`
  - `.apply(max)` => `.apply(np.maximum.reduce)`
- `UserWarning: Boolean Series key will be reindexed to match DataFrame
index.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants