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

Add testing of correct handling in case of metadata of dandiset.yaml and an asset are incorrect (according to dandischema) #1177

Open
yarikoptic opened this issue Dec 19, 2022 · 4 comments
Assignees

Comments

@yarikoptic
Copy link
Member

ref: #1176 (comment)

@yarikoptic
Copy link
Member Author

moreover, I think that code should be tuned up may be -- can't we get all individual errors from pydantic.ValidationError? ATM all invocations pass in just a single exception as a list:

❯ git grep -A1 pydantic_errors_to_validation_results
dandi/files/bases.py:                return _pydantic_errors_to_validation_results(
dandi/files/bases.py-                    [e], str(self.filepath), dandiset_path=self.dandiset_path
--
dandi/files/bases.py:                return _pydantic_errors_to_validation_results(
dandi/files/bases.py-                    [e], str(self.filepath), dandiset_path=self.dandiset_path
--
dandi/files/bases.py:                return _pydantic_errors_to_validation_results(
dandi/files/bases.py-                    [e], str(self.filepath), dandiset_path=self.dandiset_path
--
dandi/files/bases.py:def _pydantic_errors_to_validation_results(
dandi/files/bases.py-    errors: list[dict | Exception],

so it makes no sense to have a loop inside then . I think the idea was to pass a single exception and loop though contained in it errors. Please check how it can be done.

@TheChymera
Copy link
Contributor

@yarikoptic PR seems to have addressed this, can we close the issue?

@yarikoptic
Copy link
Member Author

hm, that PR #1176? it seems was closed without merging -- did I click a wrong button back then?

@TheChymera
Copy link
Contributor

@yarikoptic I think you did :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants