Repository navigation
Conversation
Normalize native Arrow types before looking up equivalent pandas dtypes. Register the binary parameterized constructor only for fixed-size binary so unregistered Arrow types cannot resolve as binary. Refs unionai-oss#2702 Signed-off-by: maoji-y <255648417+maoji-y@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #2702.
Changes
pyarrow.DataTypeinstances throughpd.ArrowDtypebefore looking up pandas aliases.pyarrow.FixedSizeBinaryTypein both modules that register pandas Arrow dtypes.Backward compatibility
The existing direct-import test now also checks that native Arrow integers and fixed-size binary are resolved correctly. The regression cases cover variable-length binary, fixed-size binary with its byte width, large binary, and timestamp parameters. Supported native Arrow types now resolve the same way as their
pd.ArrowDtypeinputs. The unregisteredmonth_day_nano_intervaltype now raisesTypeError. The 57-input alias sweep verified this error and matched the baseline for the other 56 inputs.Verification
tests/pandas tests/pyarrowpassed with 3,292 passed, 20 skipped, and 4 xfailed.git diff --checkpassed. Mypy reported the same 165 diagnostics on the base and patch in the local environment.Implemented and tested with OpenAI Codex assistance.