Skip to content

Commit

Permalink
Tags not contains filter (#612)
Browse files Browse the repository at this point in the history
* Fix for tag not contains

* Update test
  • Loading branch information
edlouth authored Aug 23, 2023
1 parent 643b5d2 commit d8f7c7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grai-server/app/lineage/graph_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def filter_by_filter(filter, query: GraphQuery) -> GraphQuery:
if row["operator"] == "contains":
query.where(f"'{value}' IN table.tags")
elif row["operator"] == "not-contains":
query.where(f"'{value}' NOT IN table.tags")
query.where(f"NOT '{value}' IN table.tags")

elif row["type"] == "ancestor":
if row["field"] == "tag":
Expand Down
2 changes: 1 addition & 1 deletion grai-server/app/lineage/tests/test_graph_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_table_tag_doesnt_contain():
filter_by_filter(filter, query)

assert len(query.clause[0].wheres) == 1
assert query.clause[0].wheres[0].where == "'tag1' NOT IN table.tags"
assert query.clause[0].wheres[0].where == "NOT 'tag1' IN table.tags"
assert query.parameters == {}


Expand Down

0 comments on commit d8f7c7c

Please sign in to comment.