Skip to content

Commit

Permalink
try default_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
talgat committed Jan 26, 2024
1 parent b1bd7bd commit 2aff072
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tarn/location/disk_dict/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ def build(self):
class ToolConfig(NoExtra):
name: str
args: Tuple = ()
kwargs: Optional[Dict[str, Any]] = Field(None, validate_default=True)

@field_validator('kwargs', always=True)
def normalize_kwargs(cls, v):
if v is None:
return {}
return v
kwargs: Optional[Dict[str, Any]] = Field(None, default_factory=dict)


class StorageConfig(NoExtra):
Expand Down

0 comments on commit 2aff072

Please sign in to comment.