diff --git a/src/zenml/models/v2/base/scoped.py b/src/zenml/models/v2/base/scoped.py index f2166ee6fa..2f2e02a65a 100644 --- a/src/zenml/models/v2/base/scoped.py +++ b/src/zenml/models/v2/base/scoped.py @@ -175,15 +175,10 @@ def apply_filter( Returns: The query with filter applied. """ - from sqlmodel import or_ - query = super().apply_filter(query=query, table=table) if self.scope_user: - scope_filter = or_( - getattr(table, "user_id") == self.scope_user, - ) - query = query.where(scope_filter) + query = query.where(getattr(table, "user_id") == self.scope_user) return query diff --git a/src/zenml/zen_stores/schemas/component_schemas.py b/src/zenml/zen_stores/schemas/component_schemas.py index 961c06a9db..448ab85003 100644 --- a/src/zenml/zen_stores/schemas/component_schemas.py +++ b/src/zenml/zen_stores/schemas/component_schemas.py @@ -86,9 +86,9 @@ class StackComponentSchema(NamedSchema, table=True): back_populates="stack_component", ) - run_or_step_logs: Optional["LogsSchema"] = Relationship( + run_or_step_logs: List["LogsSchema"] = Relationship( back_populates="artifact_store", - sa_relationship_kwargs={"cascade": "delete", "uselist": False}, + sa_relationship_kwargs={"cascade": "delete", "uselist": True}, ) connector_id: Optional[UUID] = build_foreign_key_field(