mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-03 22:23:16 +00:00
parent
3bc97e728e
commit
c59a5e882d
@ -216,6 +216,8 @@ class MetabaseSource(Source[Entity]):
|
|||||||
for chart in chart_list:
|
for chart in chart_list:
|
||||||
try:
|
try:
|
||||||
chart_details = chart["card"]
|
chart_details = chart["card"]
|
||||||
|
if not chart_details.get("table_id"):
|
||||||
|
continue
|
||||||
resp_tables = self.req_get(f"/api/table/{chart_details['table_id']}")
|
resp_tables = self.req_get(f"/api/table/{chart_details['table_id']}")
|
||||||
if resp_tables.status_code == 200:
|
if resp_tables.status_code == 200:
|
||||||
table = resp_tables.json()
|
table = resp_tables.json()
|
||||||
@ -229,17 +231,18 @@ class MetabaseSource(Source[Entity]):
|
|||||||
entity=Model_Dashboard, fqdn=dashboard_fqdn
|
entity=Model_Dashboard, fqdn=dashboard_fqdn
|
||||||
)
|
)
|
||||||
logger.debug("from entity %s", table_entity)
|
logger.debug("from entity %s", table_entity)
|
||||||
lineage = AddLineageRequest(
|
if table_entity and chart_entity:
|
||||||
edge=EntitiesEdge(
|
lineage = AddLineageRequest(
|
||||||
fromEntity=EntityReference(
|
edge=EntitiesEdge(
|
||||||
id=table_entity.id.__root__, type="table"
|
fromEntity=EntityReference(
|
||||||
),
|
id=table_entity.id.__root__, type="table"
|
||||||
toEntity=EntityReference(
|
),
|
||||||
id=chart_entity.id.__root__, type="dashboard"
|
toEntity=EntityReference(
|
||||||
),
|
id=chart_entity.id.__root__, type="dashboard"
|
||||||
|
),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
yield lineage
|
||||||
yield lineage
|
|
||||||
except Exception as err: # pylint: disable=broad-except,unused-variable
|
except Exception as err: # pylint: disable=broad-except,unused-variable
|
||||||
logger.error(traceback.print_exc())
|
logger.error(traceback.print_exc())
|
||||||
|
|
||||||
@ -264,6 +267,8 @@ class MetabaseSource(Source[Entity]):
|
|||||||
for card in card_list:
|
for card in card_list:
|
||||||
try:
|
try:
|
||||||
card_details = card["card"]
|
card_details = card["card"]
|
||||||
|
if not card_details.get("id"):
|
||||||
|
continue
|
||||||
card_detail_resp = self.req_get(f"/api/card/{card_details['id']}")
|
card_detail_resp = self.req_get(f"/api/card/{card_details['id']}")
|
||||||
if card_detail_resp.status_code == 200:
|
if card_detail_resp.status_code == 200:
|
||||||
card = card_detail_resp.json()
|
card = card_detail_resp.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user