PowerBi urls fixed (#7295)

* PowerBi urls fixed

* added constants

Co-authored-by: Onkar Ravgan <onkarravgan@Onkars-MacBook-Pro.local>
This commit is contained in:
Onkar Ravgan 2022-09-08 10:30:32 +05:30 committed by GitHub
parent 176874e0d5
commit 5aabf76b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,7 @@
"description": "Dashboard URL for PowerBI service.",
"type": "string",
"format": "uri",
"default": "https://analysis.windows.net/powerbi"
"default": "https://app.powerbi.com"
},
"scope": {
"title": "Scope",

View File

@ -38,6 +38,8 @@ from metadata.utils.logger import ingestion_logger
logger = ingestion_logger()
POWERBI_APP_URL = "https://app.powerbi.com"
class PowerbiSource(DashboardServiceSource):
def __init__(
@ -85,7 +87,7 @@ class PowerbiSource(DashboardServiceSource):
yield CreateDashboardRequest(
name=dashboard_details["id"],
# PBI has no hostPort property. All URL details are present in the webUrl property.
dashboardUrl=dashboard_details["webUrl"],
dashboardUrl=dashboard_details["webUrl"].replace(POWERBI_APP_URL, ""),
displayName=dashboard_details["displayName"],
description="",
charts=[
@ -180,7 +182,7 @@ class PowerbiSource(DashboardServiceSource):
description="",
chartType=ChartType.Other.value,
# PBI has no hostPort property. All URL details are present in the webUrl property.
chartUrl=chart["embedUrl"],
chartUrl=chart["embedUrl"].replace(POWERBI_APP_URL, ""),
service=EntityReference(
id=self.context.dashboard_service.id.__root__,
type="dashboardService",