You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opened a PR though we have one already opened: #51309.
Might be wrong, but the process seems very similar to other reviews where quite a lot of time is needed to communicate with the contributor (or the contributor's agent) what would be good to change. Decided to fix this quickly by myself.
Converting to draft as I need to think about Copilot's comment, looks right from a quick read.
I also need to rebase as I included some changes that have been fixed by #51307
I decided to remove changes connected to the depr warning in __dlpack__:
The solution would need or check if warning is turned into an error and calling a deleter, or constructing a PyCapsule before emitting a warning. Both seem to be things that need some discussion and a fix in a separate issue I think.
The reason will be displayed to describe this comment to others. Learn more.
While this makes the test run without the warning, I am not sure if then the surrounding asserts still make sense.
One thing to do is also to change expected = np.dtype('m8') to use "m8[s]", but no idea if that would then still have produced the initial bug (the reason this test was added, #13553)
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK, sorry. Didn't try locally and assumed np.dtype(np.timedelta64) produces same result for any unit. I am guessing we want to keep testing this even for higher numpy versions. Will look first into changing expected value and what that means for the initial bug.
@AlenkaF thanks for the PR! I triggered a nightly pandas/numpy crossbow build, because it is there that I checked for the warnings (it might be that some of those were also showing up in the main CI builds, though)
Handle NumPy nightly prerelease versions in deprecated-path guards
python/pyarrow/tests/test_array.py:2684
A PEP 440 nightly such as 2.5.0.devN compares less than Version("2.5.0"), so these guards still run the deprecated generic-unit paths in NumPy nightly—the exact environments this change targets. Compare the release/base version (and apply the same correction to the inverse guard in test_array_from_numpy_timedelta_incorrect_unit) so prereleases are handled consistently.
The reason will be displayed to describe this comment to others. Learn more.
I was not sure this needs to be addressed, but you asking means it should be ;)
My thought process was: check_freq will be tested by default and as we do not keep freq information from pandas (AFAIU) we might default to keeping the current behavior which is not checking the frequency in any of our roundtrips. Have no problem to change this as suggested though.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Unresolved moderate findings remain in the pandas and NumPy test updates.
Review effort: Lite Findings: None
Previously missed (2)
In code that hasn't changed since last review
Filter deprecation warnings instead of skipping coverage
python/pyarrow/tests/test_array.py:2684
These conditionals skip the generic-unit tests on NumPy 2.5+, even though this deprecation is still a warning and the constructors continue to run. That removes coverage of Arrow's rejection of generic datetime/timedelta units on the nightly versions this PR targets (the same pattern is used in the timedelta test below); please filter the expected warning around the deprecated constructor instead of skipping the behavior test.
This changes the regression test from checking the generic np.timedelta64 dtype before and after conversion to checking only a concrete seconds dtype. The generic dtype is the state this test is intended to detect Arrow mutating, so a regression there would now pass unnoticed; keep the generic assertions and only make the DataFrame value explicit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Rationale for this change
Test warnings accumulated in our CI.
What changes are included in this PR?
The warnings are fixed or filtered if the deprecated functionality is still being tested.
Are these changes tested?
Yes.
Are there any user-facing changes?
No. Fixing test warnings in our CI.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: