Skip to content

Commit

Permalink
apacheGH-15070: [Python][CI] Update pandas test for empty columns dty…
Browse files Browse the repository at this point in the history
…pe change in pandas 2.0.1
  • Loading branch information
jorisvandenbossche committed Apr 11, 2023
1 parent c70c3d5 commit 42a5dfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/pyarrow/tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2828,8 +2828,12 @@ def test_partial_schema(self):

def test_table_batch_empty_dataframe(self):
df = pd.DataFrame({})
_check_pandas_roundtrip(df)
_check_pandas_roundtrip(df, as_batch=True)
_check_pandas_roundtrip(df, preserve_index=None)
_check_pandas_roundtrip(df, preserve_index=None, as_batch=True)

expected = pd.DataFrame(columns=pd.Index([]))
_check_pandas_roundtrip(df, expected, preserve_index=False)
_check_pandas_roundtrip(df, expected, preserve_index=False, as_batch=True)

df2 = pd.DataFrame({}, index=[0, 1, 2])
_check_pandas_roundtrip(df2, preserve_index=True)
Expand Down

0 comments on commit 42a5dfe

Please sign in to comment.