Fixes Tableau + fix Charts not getting ingested as part of dashboard (#4327)

* Fixes Tableau + fix Charts not getting ingested as part of dashboard

* pytest fix

* Fix Tableau json config
This commit is contained in:
Ayush Shah 2022-04-22 16:19:55 +05:30 committed by GitHub
parent 2bd5d02b2b
commit a94bb5fc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View File

@ -62,14 +62,15 @@
"description": "Tableau Environment Name",
"type": "string"
},
"dbServiceName": {
"description": "Database Service Name in order to create a lineage",
"type": "string"
},
"supportsMetadataExtraction": {
"title": "Supports Metadata Extraction",
"$ref": "../connectionBasicType.json#/definitions/supportsMetadataExtraction"
}
},
"additionalProperties": false,
"required": [
"hostPort",
"username"
]
"required": ["hostPort", "apiVersion", "siteName"]
}

View File

@ -174,7 +174,7 @@ class TableauSource(Source[Entity]):
try:
table_fqdn = datasource.split("(")[1].split(")")[0]
dashboard_fqdn = f"{self.config.serviceName}.{dashboard_name}"
table_fqdn = f"{self.config.serviceName}.{table_fqdn}"
table_fqdn = f"{self.connection_config.dbServiceName}.{table_fqdn}"
table_entity = self.metadata_client.get_by_name(
entity=Table, fqdn=table_fqdn
)
@ -194,6 +194,7 @@ class TableauSource(Source[Entity]):
)
yield lineage
except (Exception, IndexError) as err:
logger.debug(traceback.format_exc())
logger.error(err)
def _get_tableau_dashboard(self) -> Dashboard:
@ -223,7 +224,7 @@ class TableauSource(Source[Entity]):
chart = self.all_dashboard_details["workbook"][chart_index]
if chart["id"] == dashboard_id:
dashboard_chart.append(
self.all_dashboard_details["name"][chart_index]
self.all_dashboard_details["id"][chart_index]
)
yield Dashboard(
id=uuid.uuid4(),
@ -240,7 +241,7 @@ class TableauSource(Source[Entity]):
last_modified=dateparser.parse(chart["updatedAt"]).timestamp()
* 1000,
)
if self.config.serviceName:
if self.connection_config.dbServiceName:
yield from self.get_lineage(datasource_list, dashboard_id)
except Exception as err:
logger.debug(traceback.format_exc())

View File

@ -219,9 +219,11 @@ class OMetaServiceTest(TestCase):
"username": "tb_user",
"password": "tb_pwd",
"hostPort": "http://random:1234",
"siteName": "openmetadata",
"apiVersion": "3.15",
}
},
"sourceConfig": {"config": {}},
"sourceConfig": {"config": {"topicFilterPattern": {}}},
}
workflow_source = WorkflowSource(**data)