GH-51301: [Python] Fix NumPy and pandas nightly warnings - #51309
GH-51301: [Python] Fix NumPy and pandas nightly warnings#51309akashchamp wants to merge 1 commit into
Conversation
|
|
| with pytest.warns(DeprecationWarning, match="unversioned DLPack capsule"): | ||
| with pytest.raises(NotImplementedError, | ||
| match="Legacy DLPack support is not implemented " | ||
| "for immutable tensors"): | ||
| tensor.__dlpack__(max_version=max_version) |
There was a problem hiding this comment.
This seems to be an issue with our own implementation? (we should not be raising both a warning an error at the same time? assuming they both from our code)
cc @AlenkaF
There was a problem hiding this comment.
Ha, this is coming from our code, yes.
DeprecationWarning is triggered in Cython, NotImplementedError is triggered in C++. I think we only need to change the order here:
arrow/python/pyarrow/array.pxi
Lines 2375 to 2379 in 9ae25f1
where the warning is triggered only after legacy_tensor is successfully created. Same in tensor.pxi.
I can create a separate PR tomorrow, if this change is out of scope for this issue.
Rationale for this change
Fixes: #51301.
NumPy and pandas nightly builds emit deprecation warnings from PyArrow tests, which obscures compatibility signals.
What changes are included in this PR?
This updates pandas datetime accessors and Timestamp parsing, requests versioned DLPack exports outside legacy-behavior coverage, captures the expected warning where legacy DLPack behavior is intentionally tested, scopes intentional generic NumPy-unit warnings, and makes the pandas comparison and timedelta inputs explicit.
Are these changes tested?
Series.valuesPandas4Warning tracked separately in [Python] Update pandas->pyarrow conversion for the .values deprecation in pandas #51302. That exact warning was filtered solely for the-W errorvalidation command; this PR does not suppress it.Are there any user-facing changes?
No.
used codex with pr development