pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int'
NONE
I think the Counter object you used in 'labels' may be the issue, since the {2:1} inside is the dict and 2 is the int
2025-07-04T05:07:35Z
https://github.com/huggingface/datasets/issues/7446#issuecomment-3034553795
https://api.github.com/repos/huggingface/datasets/issues/7446
IC_kwDODunzps60353D
https://api.github.com/repos/huggingface/datasets/issues/comments/3034553795/reactions
2025-07-04T05:07:35Z
https://api.github.com/repos/huggingface/datasets/issues/comments/3034553795
https://avatars.githubusercontent.com/u/57196296?v=4
https://api.github.com/users/EagerSun/events{/privacy}
https://api.github.com/users/EagerSun/followers
https://api.github.com/users/EagerSun/following{/other_user}
https://api.github.com/users/EagerSun/gists{/gist_id}
https://github.com/EagerSun
EagerSun
MDQ6VXNlcjU3MTk2Mjk2
https://api.github.com/users/EagerSun/orgs
https://api.github.com/users/EagerSun/received_events
https://api.github.com/users/EagerSun/repos
https://api.github.com/users/EagerSun/starred{/owner}{/repo}
https://api.github.com/users/EagerSun/subscriptions
User
https://api.github.com/users/EagerSun
public
NONE
> I think the Counter object you used in 'labels' may be the issue, since the {2:1} inside is the dict and 2 is the int我认为您在 'labels' 中使用的 Counter 对象可能是问题所在，因为里面的 {2：1} 是 dict，而 2 是 int

Yes, that's the point.
2025-07-04T05:14:45Z
https://github.com/huggingface/datasets/issues/7446#issuecomment-3034563820
https://api.github.com/repos/huggingface/datasets/issues/7446
IC_kwDODunzps6038Ts
https://api.github.com/repos/huggingface/datasets/issues/comments/3034563820/reactions
2025-07-04T05:14:45Z
https://api.github.com/repos/huggingface/datasets/issues/comments/3034563820
https://avatars.githubusercontent.com/u/88258534?v=4
https://api.github.com/users/rangehow/events{/privacy}
https://api.github.com/users/rangehow/followers
https://api.github.com/users/rangehow/following{/other_user}
https://api.github.com/users/rangehow/gists{/gist_id}
https://github.com/rangehow
rangehow
MDQ6VXNlcjg4MjU4NTM0
https://api.github.com/users/rangehow/orgs
https://api.github.com/users/rangehow/received_events
https://api.github.com/users/rangehow/repos
https://api.github.com/users/rangehow/starred{/owner}{/repo}
https://api.github.com/users/rangehow/subscriptions
User
https://api.github.com/users/rangehow
public
### Describe the bug

A dict with its keys are all str but get following error
```python
test_data=[{'input_ids':[1,2,3],'labels':[[Counter({2:1})]]}]
dataset = datasets.Dataset.from_list(test_data)
```
```bash
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