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

Check that compat is equal to identical only once in dataset concat #8538

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions xarray/core/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ def _dataset_concat(
result_encoding = datasets[0].encoding

# check that global attributes are fixed across all datasets if necessary
for ds in datasets[1:]:
if compat == "identical" and not utils.dict_equiv(ds.attrs, result_attrs):
raise ValueError("Dataset global attributes not equal.")
if compat == "identical":
for ds in datasets[1:]:
if not utils.dict_equiv(ds.attrs, result_attrs):
raise ValueError("Dataset global attributes not equal.")

# we've already verified everything is consistent; now, calculate
# shared dimension sizes so we can expand the necessary variables
Expand Down
Loading