Skip to content

Commit cf4d334

Browse files
jbrockmendelsimonjayhawkins
authored andcommitted
BUG: pytables in py39 (pandas-dev#38041)
* BUG: pytables in py39 * add pytables to py39 ci * whatsnew 1.1.5 * scipy and pyarrow to py39 build
1 parent 345e9fc commit cf4d334

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

ci/deps/azure-39.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ dependencies:
1515
- numpy
1616
- python-dateutil
1717
- pytz
18+
19+
# optional dependencies
20+
- pytables
21+
- scipy
22+
- pyarrow=1.0

doc/source/whatsnew/v1.1.5.rst

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Bug fixes
2828
- Bug in metadata propagation for ``groupby`` iterator (:issue:`37343`)
2929
- Bug in indexing on a :class:`Series` with ``CategoricalDtype`` after unpickling (:issue:`37631`)
3030
- Bug in :class:`RollingGroupby` with the resulting :class:`MultiIndex` when grouping by a label that is in the index (:issue:`37641`)
31+
- Bug in pytables methods in python 3.9 (:issue:`38041`)
3132
-
3233

3334
.. ---------------------------------------------------------------------------

pandas/core/computation/pytables.py

+4
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@ def visit_Subscript(self, node, **kwargs):
426426
except AttributeError:
427427
pass
428428

429+
if isinstance(slobj, Term):
430+
# In py39 np.ndarray lookups with Term containing int raise
431+
slobj = slobj.value
432+
429433
try:
430434
return self.const_type(value[slobj], self.env)
431435
except TypeError as err:

pandas/tests/io/pytables/test_store.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4500,7 +4500,7 @@ def test_categorical(self, setup_path):
45004500

45014501
# Appending must have the same categories
45024502
df3 = df.copy()
4503-
df3["s"].cat.remove_unused_categories(inplace=True)
4503+
df3["s"] = df3["s"].cat.remove_unused_categories()
45044504

45054505
with pytest.raises(ValueError):
45064506
store.append("df3", df3)

0 commit comments

Comments
 (0)