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

fix: Python 3.8 unit tests #2594

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions tests/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import random
import re
import sys
import time
import uuid
from datetime import date, datetime
Expand All @@ -28,6 +29,7 @@

is_ray_modin = wr.engine.get() == EngineEnum.RAY and wr.memory_format.get() == MemoryFormatEnum.MODIN
is_pandas_2_x = False
is_python_3_8_x = sys.version_info.major == 3 and sys.version_info.minor == 8

if is_ray_modin:
from modin.pandas import DataFrame as ModinDataFrame
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_s3_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
import awswrangler as wr
import awswrangler.pandas as pd

from .._utils import is_ray_modin
from .._utils import is_python_3_8_x, is_ray_modin

logging.getLogger("awswrangler").setLevel(logging.DEBUG)

pytestmark = pytest.mark.distributed


@pytest.mark.xfail(
condition=is_python_3_8_x,
reason="Python 3.8 uses older version of Pandas, which doesn't support the usage of index=False with orient='records'",
raises=ValueError,
)
@pytest.mark.parametrize("use_threads", [True, False, 2])
def test_full_table(path, use_threads):
df = pd.DataFrame(
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_s3_text_compressed.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import awswrangler as wr
import awswrangler.pandas as pd

from .._utils import get_df_csv, is_ray_modin
from .._utils import get_df_csv, is_python_3_8_x, is_ray_modin

EXT = {"gzip": ".gz", "bz2": ".bz2", "xz": ".xz", "zip": ".zip"}

Expand Down Expand Up @@ -127,6 +127,11 @@ def test_json(path: str, compression: str | None) -> None:
assert df.shape == df2.shape == df3.shape


@pytest.mark.xfail(
condition=is_python_3_8_x,
reason="Python 3.8 uses older version of Pandas, which doesn't support the usage of index=False with orient='records'",
raises=ValueError,
)
@pytest.mark.parametrize("chunksize", [None, 1])
@pytest.mark.parametrize("compression", ["gzip", "bz2", "xz", "zip", None])
def test_partitioned_json(path: str, compression: str | None, chunksize: int | None) -> None:
Expand Down
Loading