Skip to content

Commit

Permalink
BUG: pytables in py39 (#38041) (#38061)
Browse files Browse the repository at this point in the history
Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
  • Loading branch information
simonjayhawkins and jbrockmendel authored Nov 25, 2020
1 parent 345e9fc commit 6d5d7df
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ci/deps/azure-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ dependencies:
- numpy
- python-dateutil
- pytz

# optional dependencies
- pytables
- scipy
- pyarrow=1.0
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.1.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Bug fixes
- Bug in metadata propagation for ``groupby`` iterator (:issue:`37343`)
- Bug in indexing on a :class:`Series` with ``CategoricalDtype`` after unpickling (:issue:`37631`)
- Bug in :class:`RollingGroupby` with the resulting :class:`MultiIndex` when grouping by a label that is in the index (:issue:`37641`)
- Bug in pytables methods in python 3.9 (:issue:`38041`)
-

.. ---------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ def visit_Subscript(self, node, **kwargs):
except AttributeError:
pass

if isinstance(slobj, Term):
# In py39 np.ndarray lookups with Term containing int raise
slobj = slobj.value

try:
return self.const_type(value[slobj], self.env)
except TypeError as err:
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/pytables/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -4500,7 +4500,7 @@ def test_categorical(self, setup_path):

# Appending must have the same categories
df3 = df.copy()
df3["s"].cat.remove_unused_categories(inplace=True)
df3["s"] = df3["s"].cat.remove_unused_categories()

with pytest.raises(ValueError):
store.append("df3", df3)
Expand Down

0 comments on commit 6d5d7df

Please sign in to comment.