Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect row ordering when concatenating datasets along axis=1 #3273

Closed
mariosasko opened this issue Nov 15, 2021 · 0 comments · Fixed by #3288
Closed

Respect row ordering when concatenating datasets along axis=1 #3273

mariosasko opened this issue Nov 15, 2021 · 0 comments · Fixed by #3288
Labels
bug Something isn't working

Comments

@mariosasko
Copy link
Collaborator

Currently, there is a bug when concatenating datasets along axis=1 if more than one dataset has the _indices attribute defined. In that scenario, all indices mappings except the first one get ignored.

A minimal reproducible example:

>>> from datasets import Dataset, concatenate_datasets
>>> a = Dataset.from_dict({"a": [30, 20, 10]})
>>> b = Dataset.from_dict({"b": [2, 1, 3]})
>>> d = concatenate_datasets([a.sort("a"), b.sort("b")], axis=1)
>>> print(d[:3])              # expected: {'a': [10, 20, 30], 'b': [1, 2, 3]}
{'a': [10, 20, 30], 'b': [3, 1, 2]}

I've noticed the bug while working on #3195.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant