Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get_tags no longer return tag_count 0 tag #230

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions metadata_service/proxy/neo4j_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,10 @@ def get_tags(self) -> List:
# todo: Currently all the tags are default type, we could open it up if we want to include badge
query = textwrap.dedent("""
MATCH (t:Tag{tag_type: 'default'})
OPTIONAL MATCH (resource)-[:TAGGED_BY]->(t)
RETURN t as tag_name, count(distinct resource.key) as tag_count
OPTIONAL MATCH (tbl:Table)-[:TAGGED_BY]->(t)
WITH t as tag_name, count(distinct tbl.key) as tag_count
WHERE tag_count > 0
RETURN t as tag_name, count(distinct tbl.key) as tag_count
""")

records = self._execute_cypher_query(statement=query,
Expand Down