Skip to content

Commit 6f6970a

Browse files
committed
o Add safeguard for engine passed
1 parent f17d810 commit 6f6970a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uxarray/core/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ def _open_dataset_with_fallback(filename_or_obj, chunks=None, **kwargs):
3333
return xr.open_dataset(filename_or_obj, chunks=chunks, **kwargs)
3434
except Exception:
3535
# If it fails, use the "netcdf4" engine as backup
36+
# Extract engine from kwargs to prevent duplicate parameter error
37+
engine = kwargs.pop("engine", "netcdf4")
3638
return xr.open_dataset(
37-
filename_or_obj, engine="netcdf4", chunks=chunks, **kwargs
39+
filename_or_obj, engine=engine, chunks=chunks, **kwargs
3840
)
3941

4042

0 commit comments

Comments
 (0)