Skip to content

BUG: pytables in py39 #38041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,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 @@ -4462,7 +4462,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()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated, just getting rid of a FutureWarning


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