-
-
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
2af21ab
1a3e7df
d6a47b7
7ed1f0a
60c1158
d2334e4
ef3e07c
c07e7ea
017713b
9cf669b
e0e2da2
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.