Skip to content

Commit

Permalink
Backport PR #52929 on branch 2.0.x (TST/BUG: pyarrow test fixtures up…
Browse files Browse the repository at this point in the history
…casting dtypes) (#52934)

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

Co-authored-by: Luke Manley <lukemanley@gmail.com>
  • Loading branch information
meeseeksmachine and lukemanley committed Apr 26, 2023
1 parent a1c6fe0 commit cab4cf4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def data(dtype):
@pytest.fixture
def data_missing(data):
"""Length-2 array with [NA, Valid]"""
return type(data)._from_sequence([None, data[0]])
return type(data)._from_sequence([None, data[0]], dtype=data.dtype)


@pytest.fixture(params=["data", "data_missing"])
Expand Down Expand Up @@ -214,7 +214,8 @@ def data_for_sorting(data_for_grouping):
A < B < C
"""
return type(data_for_grouping)._from_sequence(
[data_for_grouping[0], data_for_grouping[7], data_for_grouping[4]]
[data_for_grouping[0], data_for_grouping[7], data_for_grouping[4]],
dtype=data_for_grouping.dtype,
)


Expand All @@ -227,7 +228,8 @@ def data_missing_for_sorting(data_for_grouping):
A < B and NA missing.
"""
return type(data_for_grouping)._from_sequence(
[data_for_grouping[0], data_for_grouping[2], data_for_grouping[4]]
[data_for_grouping[0], data_for_grouping[2], data_for_grouping[4]],
dtype=data_for_grouping.dtype,
)


Expand Down

0 comments on commit cab4cf4

Please sign in to comment.