-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
No deprecation warning, while calling a function of an imported module #15081
Comments
I am not sure. Users of a library that is written in Polars shouldn't see that deprecation warning. That warning is intended for the developers of that library, not the users up the stack. |
Sure but like this direct users of Polars who have defined their own convenience functions (e.g. @stfdxv ) risk not seeing the warning The other extreme is to do what pandas currently does which is to always raise FutureWarning, which is always shown. This is too noisy in my opinion, users see warnings which they can't do anything about. A middle-ground option, which I'm hoping pandas will move to too (long discussion here pandas-dev/pandas#54970), is:
Example following the Polars policy:
|
Thanks for the report, but this is not an issue with Polars. The Python docs are really clear about this. DeprecationWarnings are ignored outside the current main. Also, FutureWarning is not applicable here. It is intended for end users, not for developers. Polars should not throw any FutureWarnings. If you want to see DeprecationWarnings outside of the main module, you can explicitly opt in to that: import warnings
warnings.filterwarnings("always", category=DeprecationWarning) |
Checks
Reproducible example
Log output
No response
Issue description
map_c()
is a function, which uses a deprecated polars functionmap_dict()
.map_c()
, defined locally. The deprecation warning is emitted - OK.map_c()
, which is imported from module1.py. No deprecation warning - not OK.P.S. Note the wrong value in
mapped_c
column. This is probably due to a bug, which I described in #15079. The absence of the deprecation warning makes it difficult to notice the degradation after polars upgrade.Expected behavior
Deprecation warnings should be emitted no matter the function was defined locally or imported from another module.
Installed versions
The text was updated successfully, but these errors were encountered: