Skip to content

Commit

Permalink
TST: Update pyarrow tests to test parquet faithful roundtrip for Cate…
Browse files Browse the repository at this point in the history
…gorical support

Fixes pandas-dev#27955
  • Loading branch information
galuhsahid committed Aug 19, 2019
1 parent 9f93d57 commit 61888b2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pandas/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" test parquet compat """
import datetime
from distutils.version import LooseVersion
import os
from warnings import catch_warnings

Expand Down Expand Up @@ -166,6 +167,7 @@ def compare(repeat):
df.to_parquet(path, **write_kwargs)
with catch_warnings(record=True):
actual = read_parquet(path, **read_kwargs)

tm.assert_frame_equal(expected, actual, check_names=check_names)

if path is None:
Expand Down Expand Up @@ -453,9 +455,12 @@ def test_categorical(self, pa):
# supported in >= 0.7.0
df = pd.DataFrame({"a": pd.Categorical(list("abc"))})

# de-serialized as object
expected = df.assign(a=df.a.astype(object))
check_round_trip(df, pa, expected=expected)
if LooseVersion(pyarrow.__version__) >= LooseVersion("0.15.0"):
check_round_trip(df, pa)
else:
# de-serialized as object for pyarrow < 0.15
expected = df.assign(a=df.a.astype(object))
check_round_trip(df, pa, expected=expected)

def test_s3_roundtrip(self, df_compat, s3_resource, pa):
# GH #19134
Expand Down

0 comments on commit 61888b2

Please sign in to comment.