-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR: add stacklevel to FutureWarnings (GH9584) #10676
DEPR: add stacklevel to FutureWarnings (GH9584) #10676
Conversation
1796e37
to
5f778ad
Compare
5f778ad
to
9dc7ac5
Compare
should revamp this....its pretty useful :) |
yes, on my todo list! I now patched the |
@jorisvandenbossche sounds good. Well at least the top-level ones would be a step up. |
d83058d
to
96301d1
Compare
@jreback updated this. Added a check to |
@@ -535,7 +535,7 @@ def parse_back_compat(self, w, op=None, value=None): | |||
w, op, value = w | |||
warnings.warn("passing a tuple into Expr is deprecated, " | |||
"pass the where as a single string", | |||
DeprecationWarning) | |||
DeprecationWarning, stacklevel=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoosh deep nesting here!
lgtm. what we actually need is a warning that then traverses the stack and finds the user level code as opposed to using an explict stack level, but I suspect thats a bit tricky. |
Hmm, that goes beyond my python skills, so for somebody else :-) (doubt if this is even possible) Will merge tomorrow if no further comments |
hahha |
cc @njsmith since you reported this. This should solve almost all FutureWarnings we have in pandas. |
Doing that stack traversal thing is totally doable. Really it should be added as a feature upstream, like |
Inferring the stacklevel is indeed not that difficult :-) Something like this did it:
(the |
FYI I think u have to do a del frame at the end to break the gc cycles |
@jorisvandenbossche let's merge this. I think I already changed a few as I thought you had merged this. |
@jorisvandenbossche pls rebase and merge |
98a7a40
to
3dbff35
Compare
Only check stacklevel for FutureWarnings/DeprecationWarnings for now
3dbff35
to
2c2d4e7
Compare
DEPR: add stacklevel to FutureWarnings (GH9584)
Closes #9584