Skip to content

Commit

Permalink
Update dandi/dandiapi.py
Browse files Browse the repository at this point in the history
Co-authored-by: Yaroslav Halchenko <[email protected]>
  • Loading branch information
bendichter and yarikoptic authored Nov 30, 2023
1 parent 4908500 commit a994e54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,12 @@ def has_data_standard(self, data_standard: str) -> bool:
"'data_standard' must be an RRID (of form 'RRID:XXX_NNNNNNN`) or one "
f"of the following values: {', '.join(DATA_STANDARD_MAP.keys())}"
)
assets_summary = self.get_raw_metadata()["assetsSummary"]
assets_summary = self.get_raw_metadata().get("assetsSummary")
if assets_summary is None:

Check warning on line 1251 in dandi/dandiapi.py

View check run for this annotation

Codecov / codecov/patch

dandi/dandiapi.py#L1248-L1251

Added lines #L1248 - L1251 were not covered by tests
warnings.warn(
f"The raw metadata of RemoteDandiset {self.identifier} does not contain 'assetsSummary'. "
f"Assuming that it does not contain {data_standard}.")
return False
if "dataStandard" not in assets_summary:
return False
return any(x["identifier"] == rrid for x in assets_summary["dataStandard"])
Expand Down

0 comments on commit a994e54

Please sign in to comment.