Skip to content

Commit

Permalink
Remove validator
Browse files Browse the repository at this point in the history
I don't think we need it because we have a default (empty) map
  • Loading branch information
gselzer committed Apr 5, 2022
1 parent 2549cac commit 05c57c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions npe2/_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,6 @@ def properties(self, config_key: str) -> Set[Any]:
properties_values: Set[Any] = set()
# Search all manifests for the presence of config key
for manifest in self._manifests.values():
if manifest.properties is None:
continue
if config_key not in manifest.properties:
continue
value = manifest.properties[config_key]
Expand Down
6 changes: 1 addition & 5 deletions npe2/manifest/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Config:
exclude=True,
)

properties: Optional[Dict[str, Any]] = Field(
properties: Dict[str, Any] = Field(
default={},
description="Properties for global values."
"May be appended to by other plugins"
Expand Down Expand Up @@ -165,10 +165,6 @@ def author(self) -> Optional[str]:
def _coerce_none_contributions(cls, value):
return [] if value is None else value

@validator("properties", pre=True)
def _coerce_none_properties(cls, value):
return {} if value is None else value

@root_validator
def _validate_root(cls, values: dict) -> dict:
# validate schema version
Expand Down

0 comments on commit 05c57c4

Please sign in to comment.