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

feat(ingest/tableau): support dashboard tags #6185

Merged
merged 2 commits into from Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions metadata-ingestion/src/datahub/ingestion/source/tableau.py
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
Expand Up @@ -127,6 +127,9 @@ class MetadataQueryException(Exception):
id
name
}
tags {
name
}
}
embeddedDatasources {
id
Expand Down
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