Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Client's Block CRUD methods into Mixin #16512

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
12 changes: 12 additions & 0 deletions src/prefect/_internal/schemas/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing_extensions import Self

from prefect.types import DateTime
from prefect.utilities.generics import validate_list

T = TypeVar("T")

Expand Down Expand Up @@ -59,6 +60,17 @@ def __eq__(self, other: Any) -> bool:
else:
return copy_dict == other

@classmethod
def model_validate_list(
cls,
obj: Any,
*,
strict: Optional[bool] = None,
from_attributes: Optional[bool] = None,
context: Optional[Any] = None,
) -> list[Self]:
return validate_list(cls, obj)

def __rich_repr__(self) -> Generator[tuple[str, Any, Any], None, None]:
# Display all of the fields in the model if they differ from the default value
for name, field in self.model_fields.items():
Expand Down
Loading
Loading