diff --git a/src/zenml/models/v2/core/pipeline.py b/src/zenml/models/v2/core/pipeline.py index 5166e0abb9..59dd45ff88 100644 --- a/src/zenml/models/v2/core/pipeline.py +++ b/src/zenml/models/v2/core/pipeline.py @@ -47,7 +47,7 @@ if TYPE_CHECKING: from sqlalchemy.sql.elements import ColumnElement - from zenml.models.v2.core.pipeline_run import PipelineRunResponse + from zenml.models import PipelineRunResponse, UserResponse from zenml.zen_stores.schemas import BaseSchema AnySchema = TypeVar("AnySchema", bound=BaseSchema) @@ -122,6 +122,10 @@ class PipelineResponseMetadata(WorkspaceScopedResponseMetadata): class PipelineResponseResources(WorkspaceScopedResponseResources): """Class for all resource models associated with the pipeline entity.""" + latest_run_user: Optional["UserResponse"] = Field( + default=None, + title="The user that created the latest run of this pipeline.", + ) tags: List[TagResponse] = Field( title="Tags associated with the pipeline.", ) diff --git a/src/zenml/zen_stores/schemas/pipeline_schemas.py b/src/zenml/zen_stores/schemas/pipeline_schemas.py index 1f287720ee..bad499c042 100644 --- a/src/zenml/zen_stores/schemas/pipeline_schemas.py +++ b/src/zenml/zen_stores/schemas/pipeline_schemas.py @@ -157,6 +157,9 @@ def to_model( resources = None if include_resources: resources = PipelineResponseResources( + latest_run_user=self.runs[-1].user.to_model() + if self.runs + else None, tags=[t.tag.to_model() for t in self.tags], )