-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use explicit type check in as_compatible_data
instead of blanket access to values
attribute
#2905
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
Use explicit type check in as_compatible_data
instead of blanket access to values
attribute
#2905
Conversation
This change was prompted by the fact that `getattr(data, 'values', data)` affected any kind of data with a `values` attribute, which is not the desired behaviour at that point. This also extends tests to assert that custom objects with such an attribute are not attempted to be converted
as_compatible_data
instead of blanket access to values
attributeas_compatible_data
instead of blanket access to values
attribute
Thanks @blsqr. The tests are failing at this line: so your change isn't working yet. Can you fix it? |
This change was prompted by the fact that `getattr(data, 'values', data)` affected any kind of data with a `values` attribute, which is not the desired behaviour at that point. This also extends tests to assert that custom objects with such an attribute are not attempted to be converted
5e3aea2
to
2dc7f9f
Compare
…ata' of github.com:blusquare/xarray into enhancement/more-explicit-type-check-in-as_compatible_data
@dcherian The most recent pipeline now fails in the Could you give me a hint on how to continue? Or need this be fixed elsewhere (or is already fixed) and I need to update this topic branch? |
We can ignore that for now. |
I'm not sure that Variable is wrapping this CustomValues thing properly though. Someone else will need to chime in. |
@blsqr, I'm sorry for taking so long to review this. I updated your PR so this should be ready for merging.
that turned out not to be true, we can't wrap it in a list because then |
@keewis Thanks for looking into this and updating the PR! :) |
as_compatible_data
instead of blanket access to values
attributeas_compatible_data
instead of blanket access to values
attribute
thanks again, @blsqr |
This change was prompted by the fact that
getattr(data, 'values', data)
affected any kind of data with a
values
attribute, which is not thedesired behaviour for
core.variable.as_compatible_data
.This also extends tests to assert that custom objects with such an
attribute are not attempted to be converted.
I'm happy to write additional tests, if you could briefly sketch further requirements.
whats-new.rst
for all changes andapi.rst
for new API