Skip to content

HDFStore.__contains__ bug due to use of regex #2694

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

Closed
bsdfish opened this issue Jan 14, 2013 · 5 comments
Closed

HDFStore.__contains__ bug due to use of regex #2694

bsdfish opened this issue Jan 14, 2013 · 5 comments
Labels
Bug IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@bsdfish
Copy link

bsdfish commented Jan 14, 2013

HDFStore.contains takes the node name and uses it as a pattern to search for. That crashes if the name of the node isn't a valid regex, for example "node1(()" and doesn't function correctly if the node name is a valid regex but doesn't necessarily match itself.

@jreback
Copy link
Contributor

jreback commented Jan 14, 2013

easy fix, the reason for the regex is to allow you to pass w/o the leading '/'.....
out of curiosity, why would name a group like that?

@jreback
Copy link
Contributor

jreback commented Jan 14, 2013

and pytables gives a NaturalNameWarning on this in any event (it still works though)

@jreback
Copy link
Contributor

jreback commented Jan 14, 2013

fixed

@bsdfish
Copy link
Author

bsdfish commented Jan 14, 2013

I'm caching values w/ keys based on function calls, so perfectly valid names are 'foo(3)' or maybe 'bar("(()")' if someone ever decides to pass a string "(()" into the function. I can work around using hashes, etc but this makes it easy to follow.

@jreback
Copy link
Contributor

jreback commented Jan 14, 2013

sounds good
btw u can suppress the natural name warning easily if u want (see test_pytables.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

No branches or pull requests

3 participants