Skip to content

TST/BUG: pyarrow test fixtures upcasting dtypes #52929

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

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

lukemanley
Copy link
Member

There are a few test fixtures in test_arrow.py that create an array from a subset of another array using ArrowExtensionArray._from_sequence. They are not passing the dtype which results in upcasting for smaller dtypes.

import pandas as pd

dtype = "int32[pyarrow]"

arr = pd.array([1, 2, 3], dtype=dtype)
arr2 = type(arr)._from_sequence([arr[0], arr[1]])

print(arr2.dtype)  # -> int64[pyarrow]

@lukemanley lukemanley added Bug Testing pandas testing functions or related to the test suite Arrow pyarrow functionality labels Apr 26, 2023
@mroeschke mroeschke added this to the 2.0.2 milestone Apr 26, 2023
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM. Going to backport this just in case we backport other Arrow fixes in the 2.0.x series

@mroeschke mroeschke merged commit c632485 into pandas-dev:main Apr 26, 2023
@mroeschke
Copy link
Member

Thanks @lukemanley

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Apr 26, 2023
phofl pushed a commit that referenced this pull request Apr 26, 2023
…casting dtypes) (#52934)

Backport PR #52929: TST/BUG: pyarrow test fixtures upcasting dtypes

Co-authored-by: Luke Manley <[email protected]>
topper-123 pushed a commit to topper-123/pandas that referenced this pull request Apr 27, 2023
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
@lukemanley lukemanley deleted the arrow-test-fixture-upcasting branch May 30, 2023 22:16
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Bug Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants