Skip to content

Commit

Permalink
Don't try to sort hashable, map to string (pydata#8172)
Browse files Browse the repository at this point in the history
* Update dataset.py

* Update dataset.py

* Update dataset.py

* Remove sorted, keep it simple.

* Update dataset.py

* tests fail if tweaking this too much, just map to str then.
  • Loading branch information
Illviljan authored Sep 11, 2023
1 parent cd6ba93 commit 3edd997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5284,7 +5284,7 @@ def to_stacked_array(
if missing_sample_dims:
raise ValueError(
"Variables in the dataset must contain all ``sample_dims`` "
f"({sample_dims!r}) but '{key}' misses {sorted(missing_sample_dims)}"
f"({sample_dims!r}) but '{key}' misses {sorted(map(str, missing_sample_dims))}"
)

def stack_dataarray(da):
Expand Down

0 comments on commit 3edd997

Please sign in to comment.