Skip to content

HDFStore.get(non_existing_key) raises NoSuchNodeError #1254

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
tkf opened this issue May 18, 2012 · 1 comment
Closed

HDFStore.get(non_existing_key) raises NoSuchNodeError #1254

tkf opened this issue May 18, 2012 · 1 comment
Labels
Milestone

Comments

@tkf
Copy link
Contributor

tkf commented May 18, 2012

Here is clipped traceback. I guess you need to catch NoSuchNodeError also. Or maybe it is better to ask pytables to make NoSuchNodeError a subclass of AttributeError? I am using PyTables 2.3.1 and 0.7.3.

/.../local/lib/python2.7/site-packages/pandas/io/pytables.pyc in get(self, key)
    258         """
    259         try:
--> 260             group = getattr(self.handle.root, key)
    261             return self._read_group(group)
    262         except AttributeError:

/.../src/tables/tables/group.pyc in __getattr__(self, name)
    824             self._g_addChildrenNames()
    825             return myDict[name]
--> 826         return self._f_getChild(name)
    827 
    828 

/.../src/tables/tables/group.pyc in _f_getChild(self, childname)
    695         self._g_checkOpen()
    696 
--> 697         self._g_checkHasChild(childname)
    698 
    699         childPath = joinPath(self._v_pathname, childname)

/.../src/tables/tables/group.pyc in _g_checkHasChild(self, name)
    434             raise NoSuchNodeError(
    435                 "group ``%s`` does not have a child named ``%s``"
--> 436                 % (self._v_pathname, name))
    437         return node_type
    438 

NoSuchNodeError: group ``/`` does not have a child named ``power_change_9``
@wesm wesm closed this as completed in 5b277bd Jul 12, 2012
@wesm
Copy link
Member

wesm commented Jul 12, 2012

I made a tweak so this should work ok on pytables 2.3.1 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants