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

open_virtual_dataset HTTPS access fails #195

Closed
ayushnag opened this issue Jul 19, 2024 · 1 comment · Fixed by #196
Closed

open_virtual_dataset HTTPS access fails #195

ayushnag opened this issue Jul 19, 2024 · 1 comment · Fixed by #196

Comments

@ayushnag
Copy link
Contributor

ayushnag commented Jul 19, 2024

Currently open_virtual_dataset cannot open a dataset when given a public HTTPS url. This happens because reader_options is set on this line to s3-like syntax which probably messes up the https request. The functionality is correct in _fsspec_openfile_from_filepath so it's a pretty simple fix to just update the linked line in xarray.py

Also noticed by @kthyng in #186 (comment)

Here is an example:

>>> from virtualizarr import open_virtual_dataset
>>> open_virtual_dataset("https://github.com/pydata/xarray-data/raw/master/ROMS_example.nc", indexes={})
Traceback (most recent call last): ...
FileNotFoundError: https://github.com/pydata/xarray-data/raw/master/ROMS_example.nc
>>> import fsspec
>>> z = fsspec.filesystem("https").open("https://github.com/pydata/xarray-data/raw/master/ROMS_example.nc")
>>> z.readline()
>>> b'\x89HDF\r\n'
@ayushnag ayushnag mentioned this issue Jul 19, 2024
2 tasks
@kthyng
Copy link

kthyng commented Jul 19, 2024

Ah, thanks for noticing!

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

Successfully merging a pull request may close this issue.

2 participants