Skip to content

to_msgpack throws "PackValueError: recursion limit exceeded." for unsupported objects. #9103

Closed
@filmor

Description

@filmor

The following call fails with a PackValueError: recursion limit exceeded., spamming the console with references to pandas.msgpack.Packer._pack lines 3295 and 2391:

df = pd.DataFrame([0], index=[datetime.time(1, 2, 3)])
df.to_msgpack()

This also happens for other unsupported data like a custom object class A: pass; A() instead of datetime.time. In both cases I'd expect the function to immediately stop processing when it encounters an unsupported object (or try to pickle like to_hdf does). Also, an index of datetime.time can be produced directly from a pd.DateTimeIndex, so it would be good to at least special-case this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions