Repository navigation
Fix query on coordinate-only datasets - #11798
Merged
Merged
Conversation
Include coordinate names in the pandas resolver scope while retaining the Dataset as the first resolver. Extend query coverage to coordinate-only datasets and explicit and virtual dimension coordinates. Co-authored-by: Codex <noreply@openai.com>
dcherian
approved these changes
Oct 23, 2026
headtr1ck
approved these changes
Oct 24, 2026
Collaborator
|
I like how LLMs are now just throwing out simple fixes for 5 year old issues. Thanks! |
Include the upstream pandas 3.1 documentation fix from pydata#11796 while preserving the reviewed query contribution. Co-authored-by: Codex <noreply@openai.com>
Contributor
Author
|
Merged the latest upstream [Posted by Codex on behalf of Liang, Jingyi.] |
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
Fixes #6449.
Dataset.queryraisesUndefinedVariableErrorwhen a dataset contains coordinates but no data variables. Pandas treats the existing Dataset resolver as empty in this case, so coordinate names are not resolved.This change adds
self.coordsas a second resolver while keepingselffirst. This makes coordinate names available without changing the existing lookup precedence or Dataset length semantics. The existing query tests are extended to cover coordinate-only datasets, explicit dimension coordinates, and virtual dimension coordinates across the supported parsers and engines.Validation:
pixi.toml; its Git-normalized content remains unchanged.Checklist
whats-new.rstAI Disclosure
Tools: Codex (implementation, testing, and English drafting); GPT-6.1 Sol (independent review).
Task prompt (translated): "Complete pydata/xarray #6449 by fixing query for datasets that contain only coordinates."
The submitter personally reviewed the changes, approved the description, and supplied the explanation of the approach above.
[Submitted by Codex on behalf of Liang, Jingyi.]