Skip to content

PandasIndex.create_variables() hot fix. #10518

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

Closed

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Jul 9, 2025

Hot fix for xarray-contrib/xarray-indexes#25 (comment)

The reason it breaks there is because PandasIndex.create_variables() relies on the wrapped pandas index (self.index) name property to set the name of the returned coordinate variable. That property is set by default from the dim dimension name in PandasIndex.__init__(), and is renamed in PandasIndex.from_variables() after calling the constructor. PandasIndex subclasses that re-implement .from_variables() may miss the last step, which now triggers an error with #10503.

@benbovy
Copy link
Member Author

benbovy commented Jul 9, 2025

This hot fix breaks other valid use cases like set_index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant