Skip to content

Commit

Permalink
changed to id instead of name in dashboard entity
Browse files Browse the repository at this point in the history
  • Loading branch information
SumanMaharana committed Sep 16, 2024
1 parent f794b7c commit cad211a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
21 changes: 6 additions & 15 deletions ingestion/src/metadata/ingestion/source/dashboard/sigma/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,17 @@ def get_auth_token(self) -> Tuple[str, int]:
"""
generate auth token
"""
try:
payload = {"grant_type": "client_credentials"}
result = AuthToken(**self.token_client.post("/auth/token", data=payload))
return result.access_token, 0
except Exception as exc: # pylint: disable=broad-except
logger.debug(traceback.format_exc())
logger.error(f"Error fetching Access Token: {exc}")
payload = {"grant_type": "client_credentials"}
result = AuthToken(**self.token_client.post("/auth/token", data=payload))
return result.access_token, 0

def get_dashboards(self) -> Optional[List[Workbook]]:
"""
method to fetch dashboards from api
"""
try:
result = WorkBookResponseDetails(**self.client.get("/workbooks"))
if result:
return result.entries
except Exception as exc: # pylint: disable=broad-except
logger.debug(traceback.format_exc())
logger.error(f"Error fetching Dashboards List: {exc}")
return None
result = WorkBookResponseDetails(**self.client.get("/workbooks"))
if result:
return result.entries

def get_dashboard_detail(self, workbook_id: str) -> Optional[WorkbookDetails]:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def yield_dashboard(
"""
try:
dashboard_request = CreateDashboardRequest(
name=EntityName(str(dashboard_details.name)),
name=EntityName(str(dashboard_details.workbookId)),
displayName=dashboard_details.name,
description=Markdown(dashboard_details.description),
charts=[
Expand Down Expand Up @@ -172,7 +172,7 @@ def yield_dashboard_lineage_details(
self.metadata,
entity_type=LineageDashboard,
service_name=self.config.serviceName,
dashboard_name=str(dashboard_details.name),
dashboard_name=str(dashboard_details.workbookId),
)
to_entity = self.metadata.get_by_name(
entity=LineageDashboard,
Expand Down

0 comments on commit cad211a

Please sign in to comment.