Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DEPR: Add Deprecated warning for timedelta with passed units M and Y #23264
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 Deprecated warning for timedelta with passed units M and Y #23264
Changes from 18 commits
5eaa8d0
0a836d2
e890fa6
bfe74e5
e5e1198
d0dd551
af5d761
938c6fe
16f8b9c
5a64320
3b67476
ab52460
9cb51c5
c6f82c7
b1599a5
a21a6a2
261672e
4010bdb
3f87a0b
b7aedc1
f44bae0
5d2dceb
b745b8c
d014f56
ca0ea09
76497d3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you remove the
check_stacklevel=False
here?Here it should be work, in the one below for
to_timedelta
, it is fine to keep.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.
@jorisvandenbossche I just tried running this locally and i get an assertion error if I remove
check_stacklevel
forTimdelta
(settingstacklevel = 2
orstacklevel=3
seems to make no difference). Not sure if it will get through travis if i don't set tocheck_stacklevel=False
- i remember experimenting with this in the previous builds which failed.:../../../anaconda/envs/pandas-dev/lib/python3.7/contextlib.py:119: AssertionError
________________________________ TestTimedeltas.test_unit_m_y_deprecated[M] _________________________________
self = <pandas.tests.scalar.timedelta.test_timedelta.TestTimedeltas object at 0x1c169e02b0>, unit = 'M'
pandas/tests/scalar/timedelta/test_timedelta.py:387:
self = <contextlib._GeneratorContextManager object at 0x1c169e0438>, type = None, value = None
traceback = None
E AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/ryannazareth/anaconda/envs/pandas-dev/lib/python3.7/site-packages/_pytest/python.py != /Users/ryannazareth/Documents/Python_sprints/pandas-ryankarlos/pandas/tests/scalar/timedelta/test_timedelta.py. Warning message: M and Y units are deprecated and will be removed in a future version.
../../../anaconda/envs/pandas-dev/lib/python3.7/contextlib.py:119: AssertionError
================================== 3 failed, 75 deselected in 0.68 seconds ==================================