@@ -463,15 +463,6 @@ def open(
463463 if isinstance (filename , os .PathLike ):
464464 filename = os .fspath (filename )
465465
466- # Replace DAP protocol prefixes with https:// - netCDF4 library can't handle them
467- # These prefixes may be added by users to explicitly indicate DAP protocol
468- # Following pydap's convention, we convert to https://
469- # See: https://github.com/pydap/pydap/blob/0a2b0892611abaf0a9762ffd4f2f082cb8e497c2/src/pydap/handlers/dap.py#L103-L107
470- if isinstance (filename , str ):
471- filename_lower = filename .lower ()
472- if filename_lower .startswith (("dap2://" , "dap4://" )):
473- filename = "https://" + filename [7 :]
474-
475466 if isinstance (filename , IOBase ):
476467 raise TypeError (
477468 f"file objects are not supported by the netCDF4 backend: { filename } "
@@ -724,11 +715,6 @@ def _has_netcdf_ext(path: str | os.PathLike, is_remote: bool = False) -> bool:
724715 _ , ext = os .path .splitext (path )
725716 return ext in {".nc" , ".nc4" , ".cdf" }
726717
727- # Check for explicit DAP protocol indicators:
728- # 1. DAP scheme: dap2:// or dap4:// (case-insensitive, may not be recognized by is_remote_uri)
729- # 2. Remote URI with /dap2/ or /dap4/ in URL path (case-insensitive)
730- # Note: We intentionally do NOT check for .dap suffix as that would match
731- # file extensions like .dap which trigger downloads of binary data
732718 if isinstance (filename_or_obj , str ):
733719 url_lower = filename_or_obj .lower ()
734720 from xarray .backends .common import _is_likely_dap_url
0 commit comments