-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add back getattr for ExtensionArrays #10278
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
base: main
Are you sure you want to change the base?
Conversation
|
I did not have time to pinpoint a specific commit but it has to be one of the commits merged in last 7 days, where this one felt like the only sensible option. But I might be wrong. |
@martinfleis I will have a look then! @dcherian What is xarray's breaking change policy? I was under the impression that there was none given the date-versioning, but should there be stronger guarantees? |
We try hard to not break things. Though in. this case, we're still figuring out how to handle extension arrays. Seems like there are two options:
I lean toward one, since that makes sense for a wrapper. I don't see any way other than |
@dcherian My caution/suspicion was warranted. I just checked out |
@dcherian As for bringing back this feature, I am neutral on it because it is not in the public API. I liked your suggestion of removing it because it means that things are explicit now. But of course, if you want to bring it back, @martinfleis I will open a PR |
@dcherian It would be great if we could merge this. We have lost the import geopandas, geodatasets
geopandas.read_file(geodatasets.get_path('geoda.malaria')).to_xarray() |
@@ -142,3 +142,6 @@ def __array__( | |||
return np.asarray(self.array, dtype=dtype, copy=copy) | |||
else: | |||
return np.asarray(self.array, dtype=dtype) | |||
|
|||
def __getattr__(self, attr: str) -> Any: | |||
return getattr(self.array, attr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return getattr(self.array, attr) | |
return getattr(super().__getattribute__("array"), attr) |
cc @ilan-gold @martinfleis