Skip to content

Commit

Permalink
Merge pull request dandi#41 from candleindark/enh
Browse files Browse the repository at this point in the history
Use `default_factory` to specify validation error default
  • Loading branch information
candleindark authored Dec 12, 2024
2 parents 33e0765 + 033070b commit 139ba06
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/dandisets_linkml_status_tools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class ValidationReport(DandiBaseReport):
"""

# Error encountered in validation against a Pydantic model
pydantic_validation_errs: Json[PydanticValidationErrsType] = []
pydantic_validation_errs: Annotated[
Json[PydanticValidationErrsType], Field(default_factory=list)
]


class DandisetValidationReport(ValidationReport):
Expand Down Expand Up @@ -233,10 +235,14 @@ def dandiset_schema_version(self) -> str:
dandiset_metadata: DandiMetadata

# Error encountered in validation against the Pydantic dandiset metadata model
pydantic_validation_errs: Json[PydanticValidationErrsType] = []
pydantic_validation_errs: Annotated[
Json[PydanticValidationErrsType], Field(default_factory=list)
]

# Errors encountered in validation against the dandiset metadata model in LinkML
linkml_validation_errs: LinkmlValidationErrsType = []
linkml_validation_errs: Annotated[
LinkmlValidationErrsType, Field(default_factory=list)
]


DandisetValidationReportsType: TypeAlias = defaultdict[
Expand Down

0 comments on commit 139ba06

Please sign in to comment.