Skip to content
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

User notification if datasets are invalid. #1080

Merged
merged 12 commits into from
Jul 29, 2022
13 changes: 13 additions & 0 deletions dandi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,19 @@ def _bids_discover_and_validate(
)
if valid:
validated_datasets.append(bd)
invalid_datasets = []
for i in bids_datasets_to_validate:
if i not in validated_datasets:
invalid_datasets.append(str(i))
TheChymera marked this conversation as resolved.
Show resolved Hide resolved
if invalid_datasets:
raise RuntimeError(
TheChymera marked this conversation as resolved.
Show resolved Hide resolved
f"Found {pluralize(len(invalid_datasets), 'BIDS dataset')}, which did not "
"pass validation:\n * "
+ "\n * ".join(invalid_datasets)
+ "\nTo resolve "
"this, perform the required changes or set the validation parameter to "
'"skip" or "ignore".'
)
return validated_datasets
else:
return bids_datasets