[Pandas-dev] Empty table datasets in HDF5 (pytables)

Damion Wilson damionw at gmail.com
Fri Apr 22 10:13:44 EDT 2016


In 2012, there was this issue:

https://github.com/pydata/pandas/issues/1707

Which was patched:

https://github.com/pydata/pandas/commit/603e5ae9f8c6dc7bd17e86f556c01820c6ffed61

It now appears that this ability has been explicitly disabled, such that
the pytables interface now checks for empty datasets and silently refuses
to create the underlying HDF5 objects.

The offending code is in pandas/io/pytables.py:_write_to_group()

        # we don't want to store a table node at all if are object is 0-len
        # as there are not dtypes
        if getattr(value, 'empty', None) and (format == 'table' or append):
            return


I'm preparing a patch and pull request, but this is such a deliberate step
that I'd like some clarification as to why this is so. Reenabling this
behaviour in our production environment has the expected results with no
obvious downsides.

Can anyone provide a rationale for not introducing the patch/reenabling the
behaviour ?

Thanks in advance,

Damion K. Wilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pandas-dev/attachments/20160422/aeb39d8d/attachment.html>


More information about the Pandas-dev mailing list