Skip to content

Commit

Permalink
feat(ingest/tableau): support dashboard tags (datahub-project#6185)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and cccs-tom committed Nov 18, 2022
1 parent dbd4690 commit 1cbe60a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 9 additions & 4 deletions metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,9 +1099,7 @@ def emit_sheets_as_charts(self, workbook: Dict) -> Iterable[MetadataWorkUnit]:
# Tags
tag_list = sheet.get("tags", [])
if tag_list and self.config.ingest_tags:
tag_list_str = [
t.get("name", "").upper() for t in tag_list if t is not None
]
tag_list_str = [t.get("name", "") for t in tag_list if t is not None]
chart_snapshot.aspects.append(
builder.make_global_tag_aspect_with_tag_list(tag_list_str)
)
Expand Down Expand Up @@ -1140,7 +1138,7 @@ def emit_workbook_as_container(self, workbook: Dict) -> Iterable[MetadataWorkUni

tag_list = workbook.get("tags", [])
tag_list_str = (
[t.get("name", "").upper() for t in tag_list if t is not None]
[t.get("name", "") for t in tag_list if t is not None]
if (tag_list and self.config.ingest_tags)
else None
)
Expand Down Expand Up @@ -1246,6 +1244,13 @@ def emit_dashboards(self, workbook: Dict) -> Iterable[MetadataWorkUnit]:
)
dashboard_snapshot.aspects.append(dashboard_info_class)

tag_list = dashboard.get("tags", [])
if tag_list and self.config.ingest_tags:
tag_list_str = [t.get("name", "") for t in tag_list if t is not None]
dashboard_snapshot.aspects.append(
builder.make_global_tag_aspect_with_tag_list(tag_list_str)
)

if self.config.extract_usage_stats:
# dashboard_snapshot doesn't support the stat aspect as list element and hence need to emit MetadataWorkUnit
wu = self._get_dashboard_stat_wu(dashboard, dashboard_urn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class MetadataQueryException(Exception):
id
name
}
tags {
name
}
}
embeddedDatasources {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
"changeType": "UPSERT",
"aspectName": "globalTags",
"aspect": {
"value": "{\"tags\": [{\"tag\": \"urn:li:tag:TAGSHEET3\"}]}",
"value": "{\"tags\": [{\"tag\": \"urn:li:tag:TagSheet3\"}]}",
"contentType": "application/json"
},
"systemMetadata": {
Expand Down Expand Up @@ -817,7 +817,7 @@
"com.linkedin.pegasus2avro.common.GlobalTags": {
"tags": [
{
"tag": "urn:li:tag:TAGSHEET3"
"tag": "urn:li:tag:TagSheet3"
}
]
}
Expand Down

0 comments on commit 1cbe60a

Please sign in to comment.