Skip to content
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

GH-36541: [Python][CI] Fixup nopandas build after merge of GH-33321 #36586

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix parametrization without pandas
  • Loading branch information
jorisvandenbossche committed Jul 10, 2023
commit 9bfafb09f532e63b81967944f4391c86ea9f84e6
19 changes: 9 additions & 10 deletions python/pyarrow/tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4258,20 +4258,19 @@ def test_to_pandas_extension_dtypes_mapping():
assert isinstance(result['a'].dtype, pd.PeriodDtype)


@pytest.mark.parametrize("arr",
[pd.period_range("2012-01-01", periods=3, freq="D").array,
pd.interval_range(1, 4).array])
def test_array_to_pandas(arr):
def test_array_to_pandas():
if Version(pd.__version__) < Version("1.1"):
pytest.skip("ExtensionDtype to_pandas method missing")

result = pa.array(arr).to_pandas()
expected = pd.Series(arr)
tm.assert_series_equal(result, expected)
for arr in [pd.period_range("2012-01-01", periods=3, freq="D").array,
pd.interval_range(1, 4).array]:
result = pa.array(arr).to_pandas()
expected = pd.Series(arr)
tm.assert_series_equal(result, expected)

result = pa.table({"col": arr})["col"].to_pandas()
expected = pd.Series(arr, name="col")
tm.assert_series_equal(result, expected)
result = pa.table({"col": arr})["col"].to_pandas()
expected = pd.Series(arr, name="col")
tm.assert_series_equal(result, expected)


def test_roundtrip_empty_table_with_extension_dtype_index():
Expand Down
Loading