diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml index 745b2fc5dfd2e..1d9f8aa3b092a 100644 --- a/ci/deps/actions-312.yaml +++ b/ci/deps/actions-312.yaml @@ -34,7 +34,7 @@ dependencies: - jinja2>=3.1.2 - lxml>=4.9.2 - matplotlib>=3.6.3 - # - numba>=0.56.4 + - numba>=0.56.4 - numexpr>=2.8.4 - odfpy>=1.4.1 - qtpy>=2.3.0 @@ -44,7 +44,7 @@ dependencies: - pyarrow>=10.0.1 - pymysql>=1.0.2 - pyreadstat>=1.2.0 - # - pytables>=3.8.0 + - pytables>=3.8.0 - python-calamine>=0.1.7 - pyxlsb>=1.0.10 - s3fs>=2022.11.0 diff --git a/pandas/tests/io/pytables/test_append.py b/pandas/tests/io/pytables/test_append.py index b722a7f179479..7f7f7eccb2382 100644 --- a/pandas/tests/io/pytables/test_append.py +++ b/pandas/tests/io/pytables/test_append.py @@ -6,6 +6,7 @@ import pytest from pandas._libs.tslibs import Timestamp +from pandas.compat import PY312 import pandas as pd from pandas import ( @@ -283,7 +284,7 @@ def test_append_all_nans(setup_path): tm.assert_frame_equal(store["df2"], df, check_index_type=True) -def test_append_frame_column_oriented(setup_path): +def test_append_frame_column_oriented(setup_path, request): with ensure_clean_store(setup_path) as store: # column oriented df = DataFrame( @@ -303,6 +304,13 @@ def test_append_frame_column_oriented(setup_path): tm.assert_frame_equal(expected, result) # selection on the non-indexable + request.applymarker( + pytest.mark.xfail( + PY312, + reason="AST change in PY312", + raises=ValueError, + ) + ) result = store.select("df1", ("columns=A", "index=df.index[0:4]")) expected = df.reindex(columns=["A"], index=df.index[0:4]) tm.assert_frame_equal(expected, result) diff --git a/pandas/tests/io/pytables/test_select.py b/pandas/tests/io/pytables/test_select.py index 0e303d1c890c5..752e2fc570023 100644 --- a/pandas/tests/io/pytables/test_select.py +++ b/pandas/tests/io/pytables/test_select.py @@ -2,6 +2,7 @@ import pytest from pandas._libs.tslibs import Timestamp +from pandas.compat import PY312 import pandas as pd from pandas import ( @@ -168,7 +169,7 @@ def test_select(setup_path): tm.assert_frame_equal(expected, result) -def test_select_dtypes(setup_path): +def test_select_dtypes(setup_path, request): with ensure_clean_store(setup_path) as store: # with a Timestamp data column (GH #2637) df = DataFrame( @@ -279,6 +280,13 @@ def test_select_dtypes(setup_path): expected = df[df["A"] > 0] store.append("df", df, data_columns=True) + request.applymarker( + pytest.mark.xfail( + PY312, + reason="AST change in PY312", + raises=ValueError, + ) + ) np_zero = np.float64(0) # noqa: F841 result = store.select("df", where=["A>np_zero"]) tm.assert_frame_equal(expected, result) @@ -607,7 +615,7 @@ def test_select_iterator_many_empty_frames(setup_path): assert len(results) == 0 -def test_frame_select(setup_path): +def test_frame_select(setup_path, request): df = DataFrame( np.random.default_rng(2).standard_normal((10, 4)), columns=Index(list("ABCD"), dtype=object), @@ -624,6 +632,13 @@ def test_frame_select(setup_path): crit2 = "columns=['A', 'D']" crit3 = "columns=A" + request.applymarker( + pytest.mark.xfail( + PY312, + reason="AST change in PY312", + raises=TypeError, + ) + ) result = store.select("frame", [crit1, crit2]) expected = df.loc[date:, ["A", "D"]] tm.assert_frame_equal(result, expected) diff --git a/pandas/tests/io/pytables/test_store.py b/pandas/tests/io/pytables/test_store.py index fda385685da19..e62df0bc1c977 100644 --- a/pandas/tests/io/pytables/test_store.py +++ b/pandas/tests/io/pytables/test_store.py @@ -7,6 +7,8 @@ import numpy as np import pytest +from pandas.compat import PY312 + import pandas as pd from pandas import ( DataFrame, @@ -866,7 +868,7 @@ def test_start_stop_fixed(setup_path): df.iloc[8:10, -2] = np.nan -def test_select_filter_corner(setup_path): +def test_select_filter_corner(setup_path, request): df = DataFrame(np.random.default_rng(2).standard_normal((50, 100))) df.index = [f"{c:3d}" for c in df.index] df.columns = [f"{c:3d}" for c in df.columns] @@ -874,6 +876,13 @@ def test_select_filter_corner(setup_path): with ensure_clean_store(setup_path) as store: store.put("frame", df, format="table") + request.applymarker( + pytest.mark.xfail( + PY312, + reason="AST change in PY312", + raises=ValueError, + ) + ) crit = "columns=df.columns[:75]" result = store.select("frame", [crit]) tm.assert_frame_equal(result, df.loc[:, df.columns[:75]])