Skip to content

Commit

Permalink
Misc cleanup (#2126)
Browse files Browse the repository at this point in the history
* Remove unnecessary or condition

* Use correct type for DB relationship

* Fix linting

* Auto-update of Starter template

* Auto-update of E2E template

* Auto-update of NLP template

---------

Co-authored-by: GitHub Actions <actions@github.com>
  • Loading branch information
schustmi and actions-user authored Jan 4, 2024
1 parent 7505b7f commit 0a9e655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/zenml/models/v2/base/scoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/zenml/zen_stores/schemas/component_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0a9e655

Please sign in to comment.