Skip to content

HDFStore.get(non_existing_key) raises NoSuchNodeError #1254

Closed
@tkf

Description

@tkf

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``

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions