-
Notifications
You must be signed in to change notification settings - Fork 115
Fix method resolution bug when base class methods override getattr #1015
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?
Fix method resolution bug when base class methods override getattr #1015
Conversation
1) remove inheritance from class fsspec.spec.AbstractBufferedFile 2) copy methods from f
…ue with __getattribute__ nsidc#610
…emenov/earthaccess into 610-method_resolution_bug
I will automatically update this comment whenever this PR is modified
|
Thanks for the PR! I will work out how to make the integration-tests run on GitHub Actions. @betolink @mfisher87 I'm surprised there is no previous test using |
Have confirmation from in zulipchat that |
|
This PR closes #610.
The issue was that the getattr method does not override methods from the base class. As a result, EarthAccessFile methods were inherited from the base class fsspec.spec.AbstractBufferedFile.
To address this, getattribute is used instead of getattr. The implementation is designed to avoid infinite recursion.
The base class has been changed from fsspec.spec.AbstractBufferedFile to io.IOBase to ensure correct reading from in-memory files using xarray.
An additional test has been added to verify in-memory reading with xarray.
📚 Documentation preview 📚: https://earthaccess--1015.org.readthedocs.build/en/1015/