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

Bump pyarrow version to 14.0.1 #471

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ v3io~=0.5.14
# and 1.5.* due to https://github.com/pandas-dev/pandas/issues/49203
pandas>=1, !=1.5.*, <3
numpy>=1.16.5,<1.23
# pyarrow 13 and over cause test failures
pyarrow>=1,<13
# <15 is just a safeguard - no tests performed with pyarrow higher then 14
assaf758 marked this conversation as resolved.
Show resolved Hide resolved
pyarrow>=1,<15
assaf758 marked this conversation as resolved.
Show resolved Hide resolved
v3io-frames~=0.10.3
v3iofs~=0.1.17
xxhash>=1
Expand Down
19 changes: 14 additions & 5 deletions tests/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import pyarrow.parquet as pq
import pytest
from aiohttp import ClientConnectorError, InvalidURL
from packaging import version
from pandas.testing import assert_frame_equal

import integration.conftest
Expand Down Expand Up @@ -2721,7 +2722,9 @@ def test_write_to_parquet_partition_by_hash(tmpdir):
read_back_df = pd.read_parquet(out_file, columns=columns)
read_back_df.sort_values("my_int", inplace=True)
read_back_df.reset_index(drop=True, inplace=True)
assert read_back_df.equals(expected), f"{read_back_df}\n!=\n{expected}"
# with the introduction of s, ms, us time resolutions in pandas-2.0, the dtype of the parquet data
assaf758 marked this conversation as resolved.
Show resolved Hide resolved
# is set to datetime64[us], while default DataFrame dtype is datetime64[ns]
assert_frame_equal(expected, read_back_df, check_dtype=version.parse(pd.__version__) < version.parse("2.0.0"))


def test_write_to_parquet_partition_by_column(tmpdir):
Expand Down Expand Up @@ -2754,7 +2757,9 @@ def test_write_to_parquet_partition_by_column(tmpdir):
read_back_df = pd.read_parquet(out_file, columns=columns)
read_back_df.sort_values("my_int", inplace=True)
read_back_df.reset_index(drop=True, inplace=True)
assert read_back_df.equals(expected), f"{read_back_df}\n!=\n{expected}"
# with the introduction of s, ms, us time resolutions in pandas-2.0, the dtype of the parquet data
# is set to datetime64[us], while default DataFrame dtype is datetime64[ns]
assert_frame_equal(expected, read_back_df, check_dtype=version.parse(pd.__version__) < version.parse("2.0.0"))


def test_write_to_parquet_with_inference(tmpdir):
Expand Down Expand Up @@ -3225,10 +3230,12 @@ def test_csv_reader_parquet_write_microsecs(tmpdir):
controller.await_termination()
read_back_df = pd.read_parquet(out_file, columns=columns)

assert read_back_df.equals(expected), f"{read_back_df}\n!=\n{expected}"
# with the introduction of s, ms, us time resolutions in pandas-2.0, the dtype of the parquet data
# is set to datetime64[us], while default DataFrame dtype is datetime64[ns]
assert_frame_equal(expected, read_back_df, check_dtype=version.parse(pd.__version__) < version.parse("2.0.0"))


def test_csv_reader_parquet_write_nanosecs(tmpdir):
assaf758 marked this conversation as resolved.
Show resolved Hide resolved
def test_csv_reader_parquet_write_nanosecs_truncation(tmpdir):
out_file = f"{tmpdir}/test_csv_reader_parquet_write_nanosecs_{uuid.uuid4().hex}/"
columns = ["k", "t"]

Expand Down Expand Up @@ -3261,7 +3268,9 @@ def test_csv_reader_parquet_write_nanosecs(tmpdir):
controller.await_termination()
read_back_df = pd.read_parquet(out_file, columns=columns)

assert read_back_df.equals(expected), f"{read_back_df}\n!=\n{expected}"
# with the introduction of s, ms, us time resolutions in pandas-2.0, the dtype of the parquet data
# is set to datetime64[us], while default DataFrame dtype is datetime64[ns]
assert_frame_equal(expected, read_back_df, check_dtype=version.parse(pd.__version__) < version.parse("2.0.0"))


def test_error_in_table_persist():
Expand Down