Skip to content

Commit b6d9c89

Browse files
authored
COMPAT: Fix FutureWarning in tests with pyarrow 6.0.0 (#44662)
1 parent 7b78b73 commit b6d9c89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/tests/io/test_parquet.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pandas.compat.pyarrow import (
1818
pa_version_under2p0,
1919
pa_version_under5p0,
20+
pa_version_under6p0,
2021
)
2122
import pandas.util._test_decorators as td
2223

@@ -902,10 +903,15 @@ def test_additional_extension_types(self, pa):
902903
check_round_trip(df, pa)
903904

904905
def test_timestamp_nanoseconds(self, pa):
905-
# with version 2.0, pyarrow defaults to writing the nanoseconds, so
906+
# with version 2.6, pyarrow defaults to writing the nanoseconds, so
906907
# this should work without error
908+
# Note in previous pyarrows(<6.0.0), only the pseudo-version 2.0 was available
909+
if not pa_version_under6p0:
910+
ver = "2.6"
911+
else:
912+
ver = "2.0"
907913
df = pd.DataFrame({"a": pd.date_range("2017-01-01", freq="1n", periods=10)})
908-
check_round_trip(df, pa, write_kwargs={"version": "2.0"})
914+
check_round_trip(df, pa, write_kwargs={"version": ver})
909915

910916
def test_timezone_aware_index(self, pa, timezone_aware_date_list):
911917
if not pa_version_under2p0:

0 commit comments

Comments
 (0)