Skip to content

numpy int as dict key causes serialization failure #604

@jtruty

Description

@jtruty

I would expect this to serialize with the OPT_NON_STR_KEYS and OPT_SERIALIZE_NUMPY options:

orjson.dumps({np.int64(1): 4}, option=orjson.OPT_NON_STR_KEYS | orjson.OPT_SERIALIZE_NUMPY)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Dict key must a type serializable with OPT_NON_STR_KEYS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions