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
Fix nightly #904
Fix nightly #904
Conversation
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.
For anything that we are keeping a test related to a deprecation, I think we should remove that possibility from the stubs and update the tests accordingly.
I caught a few - not sure that I caught them all.
tests/test_scalars.py
Outdated
with pytest_warns_bounded(FutureWarning, "'H' is deprecated", lower="2.1.99"): | ||
check(assert_type(pd.Timedelta(1, "H"), pd.Timedelta), pd.Timedelta) |
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.
If 'H' is deprecated, we should update the stubs and remove/change the test.
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.
The stubs use str
not a Literal
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.
No, I see in pandas-stubs\_libs\tslibs\timedeltas.pyi
that we have TimeDeltaUnitChoices
that restricts the parameter.
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.
Thanks! Sorry, the parameters that I spot-checked were using str
tests/test_scalars.py
Outdated
with pytest_warns_bounded(FutureWarning, "'S' is deprecated", lower="2.1.99"): | ||
check(assert_type(pd.Timedelta(1, "S"), pd.Timedelta), pd.Timedelta) |
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.
same comment here as in "H"
@twoertwein let me know when I should review again, although I probably won't be able to look at it until April 17. |
Should be ready now |
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.
A few more things to fix
tests/test_scalars.py
Outdated
check(assert_type(pd.Timedelta(1, "h"), pd.Timedelta), pd.Timedelta) | ||
check(assert_type(pd.Timedelta(1, "min"), pd.Timedelta), pd.Timedelta) | ||
check(assert_type(pd.Timedelta(1, "s"), pd.Timedelta), pd.Timedelta) | ||
check(assert_type(pd.Timedelta(1, "ms"), pd.Timedelta), pd.Timedelta) | ||
check(assert_type(pd.Timedelta(1, "us"), pd.Timedelta), pd.Timedelta) | ||
check(assert_type(pd.Timedelta(1, "ns"), pd.Timedelta), pd.Timedelta) |
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.
I think all of these tests are in the code below, so this can be deleted.
"H", | ||
"T", | ||
"S", | ||
"L", | ||
"U", | ||
"N", |
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.
Need to remove "t"
, "u"
, "l"
and "n"
as well
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.
thanks @twoertwein
@twoertwein There is also a test failing due to bitwise operator behavior changing. |
I can look into the new failures when it is clear whether the ExponentialMovingWindow errors are intended or not. Opened pandas-dev/pandas#58299 |
There are still four issues on nightly - might be a pandas bug?