Skip to content

Commit

Permalink
Resolve issues from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
cswartzvi committed Sep 12, 2024
1 parent a3b5280 commit 45023a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hamilton/data_quality/pydantic_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class PydanticModelValidator(base.BaseDefaultValidator):
:param arbitrary_types_allowed: Whether arbitrary types are allowed in the model
"""

def __init__(self, model: type[BaseModel], importance: str):
def __init__(self, model: Type[BaseModel], importance: str):
super(PydanticModelValidator, self).__init__(importance)
self.model = model

self._model_adapter = TypeAdapter(model)

@classmethod
Expand All @@ -32,7 +31,7 @@ def applies_to(cls, datatype: Type[Type]) -> bool:
return custom_subclass_check(datatype, BaseModel) or custom_subclass_check(datatype, dict)

def description(self) -> str:
return "Validates that the returned object is compatible with a pydantic model"
return "Validates that the returned object is compatible with the specified pydantic model"

def validate(self, data: Any) -> base.ValidationResult:
try:
Expand Down

0 comments on commit 45023a0

Please sign in to comment.