pruning logic requires args and attrs to match
MODIFY
pangeo_forge_recipes/patterns.py
pangeo_forge_recipes/patterns.py
@@ -155,13 +155,22 @@ class FilePattern:
self.fsspec_open_kwargs = fsspec_open_kwargs if fsspec_open_kwargs else {}
self.query_string_secrets = query_string_secrets if query_string_secrets else {}
self.file_type = FileType(file_type)
- if is_opendap:
+
+ self.is_opendap = is_opendap
+ if self.is_opendap:
_deprecation_message = (
"`FilePattern(..., is_opendap=True)` will be deprecated in v0.9.0. "
"Please use `FilePattern(..., file_type='opendap')` instead."
)
warnings.warn(_deprecation_message, DeprecationWarning)
+ _maybe_default = "default" if self.file_type.value == "netcdf4" else ""
+ _overide_warning = (
+ f"`is_opendap` passed as `True`, overriding {_maybe_default} "
+ f"`file_type.value == '{self.file_type.value}' with `'opendap'`."
+ )
+ warnings.warn(_overide_warning)
self.file_type = FileType("opendap")
+
if self.fsspec_open_kwargs and self.file_type == FileType.opendap:
raise ValueError(
"OPeNDAP inputs are not opened with `fsspec`. "

pruning logic requires args and attrs to match