Skip to content
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

APIv2: pass user defined filename_or_obj to backends as is #4707

Merged
merged 5 commits into from
Dec 22, 2020
Merged

APIv2: pass user defined filename_or_obj to backends as is #4707

merged 5 commits into from
Dec 22, 2020

Conversation

alexamici
Copy link
Collaborator

@alexamici alexamici commented Dec 18, 2020

The change affects only APIv2.

Pros:

  • open_dataset passes the dataset description object filename_or_obj to the backends without fiddling with it. This is more and more important as several backends know how to open dicts, file's strs that are not paths (rasterio for example accepts GDAL strings that are not paths and that is one of the reasons engine="rasterio" cannot be used in open_dataset)

Cons:

  • at the moment backends expect paths to always be absolute, not sure if they use this info.

@pep8speaks
Copy link

pep8speaks commented Dec 18, 2020

Hello @alexamici! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-12-18 13:50:24 UTC

@alexamici alexamici marked this pull request as ready for review December 18, 2020 11:24
@alexamici alexamici changed the title WIP: pass filename_or_obj as passed by the user to beckends APIv2: pass user defined filename_or_obj to beckends as is Dec 18, 2020
@alexamici alexamici changed the title APIv2: pass user defined filename_or_obj to beckends as is WIP: APIv2: pass user defined filename_or_obj to beckends as is Dec 18, 2020
@alexamici alexamici marked this pull request as draft December 18, 2020 11:53
@alexamici alexamici marked this pull request as ready for review December 18, 2020 14:36
@alexamici alexamici changed the title WIP: APIv2: pass user defined filename_or_obj to beckends as is APIv2: pass user defined filename_or_obj to beckends as is Dec 18, 2020
@alexamici alexamici requested review from shoyer and jhamman December 18, 2020 14:37
@keewis keewis changed the title APIv2: pass user defined filename_or_obj to beckends as is APIv2: pass user defined filename_or_obj to backends as is Dec 20, 2020
@alexamici alexamici merged commit 7e2e22a into pydata:master Dec 22, 2020
toddrjen pushed a commit to toddrjen/xarray that referenced this pull request Dec 31, 2020
…4707)

* Pass filename_or_obj as passed by the user to beckends

* Code style

* Fix autodetection to also accept pathlib.Path

* ensure _get_default_engine get an str object
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.

3 participants