Skip to content

Commit

Permalink
fix(db): distinct workflows (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored Apr 3, 2024
1 parent 9417e94 commit 1e015b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion keep/api/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def get_workflows_with_last_execution(tenant_id: str) -> List[dict]:
)
.where(Workflow.tenant_id == tenant_id)
.where(Workflow.is_deleted == False)
)
).distinct()

result = session.execute(workflows_with_last_execution_query).all()

Expand Down
8 changes: 8 additions & 0 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,11 @@ def test_encode():

def test_dict_to_key_value_list():
assert functions.dict_to_key_value_list({"a": 1, "b": "test"}) == ["a:1", "b:test"]


def test_slice():
assert functions.slice("long string", 0, 4) == "long"


def test_slice_no_end():
assert functions.slice("long string", 5) == "string"

0 comments on commit 1e015b1

Please sign in to comment.