Skip to content

pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int' #7446

@rangehow

Description

@rangehow

Describe the bug

A dict with its keys are all str but get following error

test_data=[{'input_ids':[1,2,3],'labels':[[Counter({2:1})]]}]
dataset = datasets.Dataset.from_list(test_data)
pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int'

Steps to reproduce the bug

.

Expected behavior

.

Environment info

datasets 3.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions