Skip to content

Commit 105d444

Browse files
fix: Python 3.8 unit tests (#2594)
1 parent bab6c8b commit 105d444

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

tests/_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import random
55
import re
6+
import sys
67
import time
78
import uuid
89
from datetime import date, datetime
@@ -28,6 +29,7 @@
2829

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

3234
if is_ray_modin:
3335
from modin.pandas import DataFrame as ModinDataFrame

tests/unit/test_s3_select.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
import awswrangler as wr
77
import awswrangler.pandas as pd
88

9-
from .._utils import is_ray_modin
9+
from .._utils import is_python_3_8_x, is_ray_modin
1010

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

1313
pytestmark = pytest.mark.distributed
1414

1515

16+
@pytest.mark.xfail(
17+
condition=is_python_3_8_x,
18+
reason="Python 3.8 uses older version of Pandas, which doesn't support the usage of index=False with orient='records'",
19+
raises=ValueError,
20+
)
1621
@pytest.mark.parametrize("use_threads", [True, False, 2])
1722
def test_full_table(path, use_threads):
1823
df = pd.DataFrame(

tests/unit/test_s3_text_compressed.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import awswrangler as wr
1414
import awswrangler.pandas as pd
1515

16-
from .._utils import get_df_csv, is_ray_modin
16+
from .._utils import get_df_csv, is_python_3_8_x, is_ray_modin
1717

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

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

129129

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

0 commit comments

Comments
 (0)