-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Bug] .get_metadata() from embargoed dandiset #1363
Comments
at the lower API we seems by default to allow for errors with ignore_errors: bool = True,❯ git grep -A4 'def get_metadata'
dandi/cli/cmd_ls.py:def get_metadata_ls(
dandi/cli/cmd_ls.py- path, keys, errors, flatten=False, schema=None, use_fake_digest=False
dandi/cli/cmd_ls.py-):
dandi/cli/cmd_ls.py- from ..dandiset import Dandiset
dandi/cli/cmd_ls.py- from ..metadata.nwb import get_metadata, nwb2asset
--
dandi/dandiapi.py: def get_metadata(self) -> models.Dandiset:
dandi/dandiapi.py- """
dandi/dandiapi.py- Fetch the metadata for this version of the Dandiset as a
dandi/dandiapi.py- `dandischema.models.Dandiset` instance
dandi/dandiapi.py- """
--
dandi/dandiapi.py: def get_metadata(self) -> models.Asset:
dandi/dandiapi.py- """
dandi/dandiapi.py- Fetch the metadata for the asset as a `dandischema.models.Asset`
dandi/dandiapi.py- instance
dandi/dandiapi.py- """
--
dandi/files/bases.py: def get_metadata(
dandi/files/bases.py- self,
dandi/files/bases.py- digest: Digest | None = None,
dandi/files/bases.py- ignore_errors: bool = True,
dandi/files/bases.py- ) -> CommonModel:
--
dandi/files/bases.py: def get_metadata(
dandi/files/bases.py- self,
dandi/files/bases.py- digest: Digest | None = None,
dandi/files/bases.py- ignore_errors: bool = True,
dandi/files/bases.py- ) -> DandisetMeta:
--
dandi/files/bases.py: def get_metadata(
dandi/files/bases.py- self,
dandi/files/bases.py- digest: Digest | None = None,
dandi/files/bases.py- ignore_errors: bool = True,
dandi/files/bases.py- ) -> BareAsset:
--
dandi/files/bases.py: def get_metadata(
dandi/files/bases.py- self,
dandi/files/bases.py- digest: Digest | None = None,
dandi/files/bases.py- ignore_errors: bool = True,
dandi/files/bases.py- ) -> BareAsset:
--
dandi/files/bases.py: def get_metadata(
dandi/files/bases.py- self,
dandi/files/bases.py- digest: Digest | None = None,
dandi/files/bases.py- ignore_errors: bool = True,
dandi/files/bases.py- ) -> BareAsset:
--
dandi/files/bids.py: def get_metadata(
dandi/files/bids.py- self,
dandi/files/bids.py- digest: Digest | None = None,
dandi/files/bids.py- ignore_errors: bool = True,
dandi/files/bids.py- ) -> BareAsset:
--
dandi/files/bids.py: def get_metadata(
dandi/files/bids.py- self,
dandi/files/bids.py- digest: Digest | None = None,
dandi/files/bids.py- ignore_errors: bool = True,
dandi/files/bids.py- ) -> BareAsset:
--
dandi/files/bids.py: def get_metadata(
dandi/files/bids.py- self,
dandi/files/bids.py- digest: Digest | None = None,
dandi/files/bids.py- ignore_errors: bool = True,
dandi/files/bids.py- ) -> BareAsset:
--
dandi/files/zarr.py: def get_metadata(
dandi/files/zarr.py- self,
dandi/files/zarr.py- digest: Digest | None = None,
dandi/files/zarr.py- ignore_errors: bool = True,
dandi/files/zarr.py- ) -> BareAsset:
--
dandi/metadata/nwb.py:def get_metadata(
dandi/metadata/nwb.py- path: str | Path | Readable, digest: Digest | None = None
dandi/metadata/nwb.py-) -> dict | None:
dandi/metadata/nwb.py- """
dandi/metadata/nwb.py- Get "flatdata" from a .nwb file
but here we do not give such an option. Shouldn't we make it uniform and return unvalidated ones here too, wdyt @satra @jwodder ? I feel that we had related discussion at some point but I fail to find it. meanwhile
|
Great, thanks for the advice! |
@yarikoptic That |
@yarikoptic - i would agree with @jwodder that we make all fields optional so that the models can be passed. and we add a separate requirements validation that needs to pass before assets/dandisets can be published. i.e. pull validation into a separate function that enforces the requirements. that would help in situations like this. however, this brings up a point that a user may have to check if a data object is valid to make assumptions about what exists in it. i would tune this either with the pydantic 2 layer or right after it. |
I also agree with the fact @jwodder clarified ;) the question is either we should simplify people getting access to non-validated API responses (through a parameter to a call) or not (and just instruct to create those models "manually" out of raw responses, with v2 pydantic or before) |
ah, here is the issue which @sneakers-the-rat reminded me about which points to the same problematic UX: #1205 -- people expect to just get metadata (valid or not) but get an error and get stuck, we need to come back and explain the vision that draft versions might still be not fulfilling the model etc.
and/or alternatively: guide user by exception better, e.g. instead of just
make it
or simply adding WDYT? edit: we could even make it |
Long-term, once the overhaul of dandischema's models takes place, draft versions will fulfill a model. |
@yarikoptic Regarding adding |
I would like to get back to this one. Why do you think it would be that bad @jwodder ? |
@yarikoptic - let's address dandi/dandi-schema#205 this now that pydantic has been upgraded. it will solve a bunch of issues, but we do need coordinated effort to make this work. i was hoping we have cli and archive updated with dandi-schema release before this happened. |
|
ok, then let's at least make that exception more informative to guide user like I outlined above. Agree? |
Add notes to docs about `get_metadata()` vs. `get_raw_metadata()`
🚀 Issue was released in |
I'd be happy to set this value on the dandiset, but I don't know how to and it wasn't required to create the dandiset either
The text was updated successfully, but these errors were encountered: