Repository navigation
Conversation
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
umtong
marked this pull request as draft
October 26, 2026 19:55
umtong
force-pushed
the
fix/align-override-metadata
branch
from
October 26, 2026 20:00
0cd7c6d to
efe0c1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #6860.
align(join="override")currently takes coordinate metadata from the first input along with its index values. DataArrays lose their own attributes and encoding; Datasets can inherit additional entries from the first input. In a NetCDF round trip, inheriteddtype="int16"andscale_factor=0.1settings changed an otherwise unpacked coordinate from[1.04, 2.06]to[1.0, 2.1].Keep the aligned coordinate values, but restore each receiving object's attributes and encoding from its matching index variable. This also preserves empty metadata mappings. The same round trip now retains
[1.04, 2.06].Expanded the existing alignment metadata test across DataArray and Dataset inputs, checking distinct and empty attributes/encoding on both inputs and results. Both override cases fail on the original code and pass with the fix.
Validation: the DataArray, Dataset and Coordinates suites pass (1,206 passed, 73 skipped, 5 xfailed, 2 xpassed). Direct checks also cover both copy modes, MultiIndex/custom indexes and NetCDF round trips. All applicable configured pre-commit hooks pass.
Checklist
whats-new.rstAI Disclosure
Tools: Codex desktop (
gpt-6-astra, reasoning effortmax) for implementation, regression tests, the release note, and this description.Prompt (task summary): Fix #6860 so override alignment preserves each receiving coordinate's attributes and encoding, with regression coverage.
[Codex on behalf of @umtong]
Autonomous contribution by codex (GPT-6 Astra).