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

Fix nightly #904

Merged
merged 7 commits into from Apr 17, 2024
Merged

Fix nightly #904

merged 7 commits into from Apr 17, 2024

Conversation

twoertwein
Copy link
Member

There are still four issues on nightly - might be a pandas bug?

FAILED tests/test_groupby.py::test_frame_groupby_ewm - AttributeError: 'ExponentialMovingWindowGroupby' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_groupby.py::test_series_groupby_ewm - AttributeError: 'ExponentialMovingWindowGroupby' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_windowing.py::test_ewm_aggregate - AttributeError: 'ExponentialMovingWindow' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_windowing.py::test_ewm_aggregate_series - AttributeError: 'ExponentialMovingWindow' object has no attribute 'apply'. Did you mean: '_apply'?

Copy link
Collaborator

@Dr-Irv Dr-Irv left a 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_pandas.py Outdated Show resolved Hide resolved
tests/test_pandas.py Outdated Show resolved Hide resolved
Comment on lines 388 to 389
with pytest_warns_bounded(FutureWarning, "'H' is deprecated", lower="2.1.99"):
check(assert_type(pd.Timedelta(1, "H"), pd.Timedelta), pd.Timedelta)
Copy link
Collaborator

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.

Copy link
Member Author

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

Copy link
Collaborator

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.

Copy link
Member Author

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

Comment on lines 391 to 392
with pytest_warns_bounded(FutureWarning, "'S' is deprecated", lower="2.1.99"):
check(assert_type(pd.Timedelta(1, "S"), pd.Timedelta), pd.Timedelta)
Copy link
Collaborator

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"

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Apr 11, 2024

@twoertwein let me know when I should review again, although I probably won't be able to look at it until April 17.

@twoertwein
Copy link
Member Author

@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

Copy link
Collaborator

@Dr-Irv Dr-Irv left a 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

Comment on lines 388 to 393
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)
Copy link
Collaborator

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.

Comment on lines -51 to -56
"H",
"T",
"S",
"L",
"U",
"N",
Copy link
Collaborator

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

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @twoertwein

@Dr-Irv Dr-Irv merged commit 072997b into pandas-dev:main Apr 17, 2024
13 checks passed
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Apr 17, 2024

There are still four issues on nightly - might be a pandas bug?

FAILED tests/test_groupby.py::test_frame_groupby_ewm - AttributeError: 'ExponentialMovingWindowGroupby' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_groupby.py::test_series_groupby_ewm - AttributeError: 'ExponentialMovingWindowGroupby' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_windowing.py::test_ewm_aggregate - AttributeError: 'ExponentialMovingWindow' object has no attribute 'apply'. Did you mean: '_apply'?
FAILED tests/test_windowing.py::test_ewm_aggregate_series - AttributeError: 'ExponentialMovingWindow' object has no attribute 'apply'. Did you mean: '_apply'?

@twoertwein
We are still failing due to the above. Can you post an issue in pandas about those?

There is also a test failing due to bitwise operator behavior changing.

@twoertwein
Copy link
Member Author

I can look into the new failures when it is clear whether the ExponentialMovingWindow errors are intended or not.

Opened pandas-dev/pandas#58299

@twoertwein twoertwein deleted the nightly branch April 21, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants