Skip to content

Commit

Permalink
style: use default_factory to specify validation error default
Browse files Browse the repository at this point in the history
This eliminate complain from PyCharm as well
  • Loading branch information
candleindark committed Dec 12, 2024
1 parent 33e0765 commit 033070b
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 033070b

Please sign in to comment.