Skip to content

Commit 336cc6c

Browse files
authored
BUG: pytables in py39 (#38041)
* BUG: pytables in py39 * add pytables to py39 ci * whatsnew 1.1.5 * scipy and pyarrow to py39 build
1 parent 5f5350b commit 336cc6c

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

ci/deps/azure-39.yaml

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,10 @@ def visit_Subscript(self, node, **kwargs):
430430
except AttributeError:
431431
pass
432432

433+
if isinstance(slobj, Term):
434+
# In py39 np.ndarray lookups with Term containing int raise
435+
slobj = slobj.value
436+
433437
try:
434438
return self.const_type(value[slobj], self.env)
435439
except TypeError as err:

pandas/tests/io/pytables/test_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4462,7 +4462,7 @@ def test_categorical(self, setup_path):
44624462

44634463
# Appending must have the same categories
44644464
df3 = df.copy()
4465-
df3["s"].cat.remove_unused_categories(inplace=True)
4465+
df3["s"] = df3["s"].cat.remove_unused_categories()
44664466

44674467
with pytest.raises(ValueError):
44684468
store.append("df3", df3)

0 commit comments

Comments
 (0)