python-dask/0004-Fix-test_pandas_timestamp_overflow_pyarrow-condition.patch
2024-02-29 20:31:56 -05:00

37 lines
1.4 KiB
Diff

From 9c00d60eb22e91bd6920b472c458f277f1dec964 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 19 Aug 2023 16:49:33 -0400
Subject: [PATCH 4/8] Fix test_pandas_timestamp_overflow_pyarrow condition
The new behavior in pyarrow only occurs with Pandas 2.0 as well.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
dask/dataframe/io/tests/test_parquet.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dask/dataframe/io/tests/test_parquet.py b/dask/dataframe/io/tests/test_parquet.py
index 8a854ca4..e838d20d 100644
--- a/dask/dataframe/io/tests/test_parquet.py
+++ b/dask/dataframe/io/tests/test_parquet.py
@@ -3323,13 +3323,13 @@ def test_pandas_timestamp_overflow_pyarrow(tmpdir):
table, f"{tmpdir}/file.parquet", use_deprecated_int96_timestamps=False
)
- if pyarrow_version < parse_version("13.0.0.dev"):
+ if pyarrow_version.major >= 13 and PANDAS_GE_200:
+ dd.read_parquet(str(tmpdir)).compute()
+ else:
# This will raise by default due to overflow
with pytest.raises(pa.lib.ArrowInvalid) as e:
dd.read_parquet(str(tmpdir)).compute()
assert "out of bounds" in str(e.value)
- else:
- dd.read_parquet(str(tmpdir)).compute()
from dask.dataframe.io.parquet.arrow import ArrowDatasetEngine
--
2.43.0