GH-51301: [Python] Fix NumPy and pandas nightly warnings - #51309
Open
akashchamp wants to merge 2 commits into
Open
akashchamp wants to merge 2 commits into
akashchamp wants to merge 2 commits into
Conversation
|
|
…after a successful export Array.__dlpack__ and Tensor.__dlpack__ warned about the deprecated unversioned capsule before calling into the C++ exporter, so a failing export (for example an immutable Tensor) raised NotImplementedError and emitted a DeprecationWarning at the same time. Create the legacy tensor and its capsule first and only warn once that succeeded, so the error path no longer warns and a warning escalated to an error cannot leak the exported tensor. Drop the warning expectation from test_dlpack_legacy_capsule_immutable_tensor accordingly.
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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.
It also fixes the legacy DLPack path in
Array.__dlpack__andTensor.__dlpack__(array.pxi,tensor.pxi) so the "unversioned DLPack capsule"DeprecationWarningis only emitted after the legacy tensor and its capsule were created successfully (so a warning escalated to an error cannot leak the exported tensor). Previously a failing export (for example an immutableTensor) raisedNotImplementedErrorand warned at the same time, which is whytest_dlpack_legacy_capsule_immutable_tensorhad to expect both; it now only expects the error again.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..pxireordering is covered by the existingtest_dlpack_legacy_capsule*tests and relies on CI for a runtime run.Are there any user-facing changes?
No.
used codex with pr development