Skip to content

Commit

Permalink
Protect zarr imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed Dec 3, 2024
1 parent 71d487d commit 98993fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xpublish/plugins/included/dataset_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import xarray as xr
from fastapi import APIRouter, Depends
from starlette.responses import HTMLResponse # type: ignore
from zarr.storage import attrs_key # type: ignore

from xpublish.utils.api import JSONResponse

from ...utils.zarr import get_zmetadata, get_zvariables
from .. import Dependencies, Plugin, hookimpl


Expand Down Expand Up @@ -54,6 +52,9 @@ def info(
cache=Depends(deps.cache),
) -> dict:
"""Dataset schema (close to the NCO-JSON schema)."""
from zarr.storage import attrs_key # type: ignore
from ...utils.zarr import get_zmetadata, get_zvariables

zvariables = get_zvariables(dataset, cache)
zmetadata = get_zmetadata(dataset, cache, zvariables)

Expand Down

0 comments on commit 98993fc

Please sign in to comment.