Skip to content

Commit b8216a9

Browse files
mroeschkepmhatre1
authored andcommitted
CI: Enable pytables and numba in 312 build (pandas-dev#57998)
* CI: Enable pytables and numba in 312 build * Add xfails * TypeError
1 parent 48ee528 commit b8216a9

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

ci/deps/actions-312.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies:
3434
- jinja2>=3.1.2
3535
- lxml>=4.9.2
3636
- matplotlib>=3.6.3
37-
# - numba>=0.56.4
37+
- numba>=0.56.4
3838
- numexpr>=2.8.4
3939
- odfpy>=1.4.1
4040
- qtpy>=2.3.0
@@ -44,7 +44,7 @@ dependencies:
4444
- pyarrow>=10.0.1
4545
- pymysql>=1.0.2
4646
- pyreadstat>=1.2.0
47-
# - pytables>=3.8.0
47+
- pytables>=3.8.0
4848
- python-calamine>=0.1.7
4949
- pyxlsb>=1.0.10
5050
- s3fs>=2022.11.0

pandas/tests/io/pytables/test_append.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77

88
from pandas._libs.tslibs import Timestamp
9+
from pandas.compat import PY312
910

1011
import pandas as pd
1112
from pandas import (
@@ -283,7 +284,7 @@ def test_append_all_nans(setup_path):
283284
tm.assert_frame_equal(store["df2"], df, check_index_type=True)
284285

285286

286-
def test_append_frame_column_oriented(setup_path):
287+
def test_append_frame_column_oriented(setup_path, request):
287288
with ensure_clean_store(setup_path) as store:
288289
# column oriented
289290
df = DataFrame(
@@ -303,6 +304,13 @@ def test_append_frame_column_oriented(setup_path):
303304
tm.assert_frame_equal(expected, result)
304305

305306
# selection on the non-indexable
307+
request.applymarker(
308+
pytest.mark.xfail(
309+
PY312,
310+
reason="AST change in PY312",
311+
raises=ValueError,
312+
)
313+
)
306314
result = store.select("df1", ("columns=A", "index=df.index[0:4]"))
307315
expected = df.reindex(columns=["A"], index=df.index[0:4])
308316
tm.assert_frame_equal(expected, result)

pandas/tests/io/pytables/test_select.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pytest
33

44
from pandas._libs.tslibs import Timestamp
5+
from pandas.compat import PY312
56

67
import pandas as pd
78
from pandas import (
@@ -168,7 +169,7 @@ def test_select(setup_path):
168169
tm.assert_frame_equal(expected, result)
169170

170171

171-
def test_select_dtypes(setup_path):
172+
def test_select_dtypes(setup_path, request):
172173
with ensure_clean_store(setup_path) as store:
173174
# with a Timestamp data column (GH #2637)
174175
df = DataFrame(
@@ -279,6 +280,13 @@ def test_select_dtypes(setup_path):
279280
expected = df[df["A"] > 0]
280281

281282
store.append("df", df, data_columns=True)
283+
request.applymarker(
284+
pytest.mark.xfail(
285+
PY312,
286+
reason="AST change in PY312",
287+
raises=ValueError,
288+
)
289+
)
282290
np_zero = np.float64(0) # noqa: F841
283291
result = store.select("df", where=["A>np_zero"])
284292
tm.assert_frame_equal(expected, result)
@@ -607,7 +615,7 @@ def test_select_iterator_many_empty_frames(setup_path):
607615
assert len(results) == 0
608616

609617

610-
def test_frame_select(setup_path):
618+
def test_frame_select(setup_path, request):
611619
df = DataFrame(
612620
np.random.default_rng(2).standard_normal((10, 4)),
613621
columns=Index(list("ABCD"), dtype=object),
@@ -624,6 +632,13 @@ def test_frame_select(setup_path):
624632
crit2 = "columns=['A', 'D']"
625633
crit3 = "columns=A"
626634

635+
request.applymarker(
636+
pytest.mark.xfail(
637+
PY312,
638+
reason="AST change in PY312",
639+
raises=TypeError,
640+
)
641+
)
627642
result = store.select("frame", [crit1, crit2])
628643
expected = df.loc[date:, ["A", "D"]]
629644
tm.assert_frame_equal(result, expected)

pandas/tests/io/pytables/test_store.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import numpy as np
88
import pytest
99

10+
from pandas.compat import PY312
11+
1012
import pandas as pd
1113
from pandas import (
1214
DataFrame,
@@ -866,14 +868,21 @@ def test_start_stop_fixed(setup_path):
866868
df.iloc[8:10, -2] = np.nan
867869

868870

869-
def test_select_filter_corner(setup_path):
871+
def test_select_filter_corner(setup_path, request):
870872
df = DataFrame(np.random.default_rng(2).standard_normal((50, 100)))
871873
df.index = [f"{c:3d}" for c in df.index]
872874
df.columns = [f"{c:3d}" for c in df.columns]
873875

874876
with ensure_clean_store(setup_path) as store:
875877
store.put("frame", df, format="table")
876878

879+
request.applymarker(
880+
pytest.mark.xfail(
881+
PY312,
882+
reason="AST change in PY312",
883+
raises=ValueError,
884+
)
885+
)
877886
crit = "columns=df.columns[:75]"
878887
result = store.select("frame", [crit])
879888
tm.assert_frame_equal(result, df.loc[:, df.columns[:75]])

0 commit comments

Comments
 (0)