-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: be more cautious when guessing what a backend can open #10804
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
Changes from 2 commits
2af21ab
1a3e7df
d6a47b7
7ed1f0a
60c1158
d2334e4
ef3e07c
c07e7ea
017713b
9cf669b
e0e2da2
bfefb21
a50b2f6
10d6edd
8c77986
079b290
6ee2910
418ceee
e32e93a
f445045
4a717e7
7dc0995
00d07ee
f29d7d8
d98d6dd
8f150dd
cc64d7c
8123beb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| from collections.abc import Iterable | ||
| from typing import TYPE_CHECKING, Any | ||
|
|
||
|
|
@@ -209,7 +210,14 @@ class PydapBackendEntrypoint(BackendEntrypoint): | |
| url = "https://docs.xarray.dev/en/stable/generated/xarray.backends.PydapBackendEntrypoint.html" | ||
|
|
||
| def guess_can_open(self, filename_or_obj: T_PathFileOrDataStore) -> bool: | ||
| return isinstance(filename_or_obj, str) and is_remote_uri(filename_or_obj) | ||
| if not (isinstance(filename_or_obj, str) and is_remote_uri(filename_or_obj)): | ||
| return False | ||
|
|
||
| # Check file extension to avoid claiming non-OPeNDAP URLs (e.g., remote Zarr stores) | ||
| _, ext = os.path.splitext(filename_or_obj.rstrip("/")) | ||
| # Pydap handles OPeNDAP endpoints, which typically have no extension or .nc/.nc4 | ||
| # Reject URLs with non-OPeNDAP extensions like .zarr | ||
| return ext not in {".zarr", ".zip", ".tar", ".gz"} | ||
|
||
|
|
||
| def open_dataset( | ||
| self, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.