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): add new ingestion source PowerBI Report Server #5369

Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
f631994
add powerbi report server ingestion source
Jul 11, 2022
a4db4f2
change domain fields to lower case
Jul 11, 2022
f67e25e
change imports
Jul 11, 2022
7eb76a3
fix naming,
Jul 11, 2022
bab4da0
fix yml
Jul 11, 2022
2e49c37
fix data platforms
Jul 11, 2022
95746ae
fix: fix black check
RChygir Jul 11, 2022
28dd587
Merge branch 'datahub-project:master' into feature/lytvynov_chyhir_po…
alcoccoque Jul 11, 2022
c07b6b9
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
RChygir Jul 12, 2022
3cb0e74
docs: add note to source docs
RChygir Jul 12, 2022
7a1f7d5
docs: add title
RChygir Jul 12, 2022
fc0b7e4
fix: run linters
Jul 12, 2022
299756a
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Jul 12, 2022
2fd0e2c
Merge branch 'datahub-project:master' into feature/lytvynov_chyhir_po…
alcoccoque Jul 12, 2022
1b3e609
fix: fix tests, report module
Jul 22, 2022
9c3718e
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Jul 22, 2022
961783d
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Jul 22, 2022
a7589b5
ref: change save path directory
Aug 2, 2022
a6e599e
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 2, 2022
ddcea25
feat: add test
Aug 4, 2022
fb24831
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Aug 4, 2022
ad0416f
feat: add test
Aug 4, 2022
74fca17
feat: change improts
Aug 9, 2022
d851961
fix: fix powerbi report server tests
RChygir Aug 9, 2022
0690f52
feat: change imports
Aug 9, 2022
52e6cd2
fix: update golden file
RChygir Aug 9, 2022
052a2f7
feat: change json
Aug 9, 2022
d8065c6
feat: change json
Aug 9, 2022
f989139
fix: change json
Aug 9, 2022
68cccf4
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 9, 2022
a6b95a5
fix: change order in setup
Aug 10, 2022
50e09a3
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 10, 2022
f9b6d73
fix: change pydantic import
Aug 10, 2022
a84d1e0
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Aug 10, 2022
6c9747d
fix: change docs
Aug 10, 2022
07b1fdb
fix: fix platform name
Aug 10, 2022
c3939dc
fix: fix docs
Aug 10, 2022
1cc9868
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 10, 2022
f5a8657
fix: fix docs in code
Aug 10, 2022
1be8c26
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Aug 10, 2022
f8bb760
fix: run linters
Aug 10, 2022
be3d340
fix: remove duplicate doc
Aug 10, 2022
a8dd395
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 10, 2022
1f8c1e8
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 11, 2022
fe9cd19
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 19, 2022
e294447
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 22, 2022
e2e2849
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 24, 2022
c095177
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 25, 2022
368dddf
fix: fix tests
Aug 29, 2022
032938f
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Aug 29, 2022
ef227c1
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Aug 29, 2022
f6f185a
fix: change ownership, add ownership type, include to config file
Aug 31, 2022
dc65ea1
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Aug 31, 2022
2697f69
fix: userdao
Sep 2, 2022
22788ae
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
3eb0fb5
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
a6b3a6d
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
92c0010
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
00bfa8a
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
189785a
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
6e6a613
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
dc1333b
fix: fix test test_powerbi_report_server.py
Sep 2, 2022
69447c3
fix: update golden file
RChygir Sep 2, 2022
cab6889
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
RChygir Sep 6, 2022
de8988b
fix: fix report_server.py ownership
Sep 9, 2022
ee26b50
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Sep 9, 2022
c0e4f01
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Sep 9, 2022
0ccef33
fix: linters fix
Sep 10, 2022
9c95892
Merge remote-tracking branch 'origin/feature/lytvynov_chyhir_powerbi_…
Sep 10, 2022
717704c
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
alcoccoque Sep 10, 2022
c6f0cab
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
RChygir Sep 23, 2022
e3b8ad5
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
shirshanka Oct 4, 2022
f6e570d
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
shirshanka Oct 18, 2022
c912566
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
shirshanka Oct 27, 2022
8d56c8b
fix lint
shirshanka Oct 28, 2022
905e383
remove walrus operator for 3.7 compatibility
shirshanka Oct 29, 2022
39b5fc1
Merge branch 'master' into feature/lytvynov_chyhir_powerbi_report_server
shirshanka Oct 31, 2022
e9f7988
fix goldens, change platform to powerbi
shirshanka Nov 1, 2022
e91a058
fixup docs
shirshanka Nov 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ We use a plugin architecture so that you can install only the dependencies you a
| [starburst-trino-usage](./generated/ingestion/sources/trino.md) | `pip install 'acryl-datahub[starburst-trino-usage]'` | Starburst Trino usage statistics source |
| [nifi](./generated/ingestion/sources/nifi.md) | `pip install 'acryl-datahub[nifi]'` | Nifi source |
| [powerbi](./generated/ingestion/sources/powerbi.md) | `pip install 'acryl-datahub[powerbi]'` | Microsoft Power BI source |
| [powerbi-report-server](./generated/ingestion/sources/powerbi-report-server.md) | `pip install 'acryl-datahub[powerbi-report-server]'` | Microsoft Power BI Report Server source |

### Sinks

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PowerBI Report Server

## Concept mapping

| Power BI Report Server | Datahub |
| ------------------------- | ------------------- |
| `Paginated Report` | `Dashboard` |
| `Power BI Report` | `Dashboard` |
| `Mobile Report` | `Dashboard` |
| `Linked Report` | `Dashboard` |
| `Dataset, Datasource` | `N/A` |

### Note

Current [PowerBI](https://powerbi.microsoft.com/en-us/what-is-power-bi/) module used only for work with [PowerBI Report Server](https://powerbi.microsoft.com/en-us/report-server/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
source:
type: powerbireportserver.report_server.PowerBiReportServerDashboardSource
alcoccoque marked this conversation as resolved.
Show resolved Hide resolved
config:
# Your Power BI Report Server Windows username
username: username
# Your Power BI Report Server Windows password
password: password
# Your Workstation name
workstation_name: workstation_name
# Your Power BI Report Server host URL, example: localhost:80
host_port: host_port
# Your alias for Power BI Report Server host URL, example: local_powerbi_report_server
server_alias: server_alias
# Workspace's dataset environments, example: (PROD, DEV, QA, STAGE)
env: DEV
# Workspace's dataset environments, example: (PROD, DEV, QA, STAGE)
alcoccoque marked this conversation as resolved.
Show resolved Hide resolved
graphql_url: http://localhost:8080/api/graphql
# Your Power BI Report Server base virtual directory name for reports
report_virtual_directory_name: Reports
# Your Power BI Report Server base virtual directory name for report server
report_server_virtual_directory_name: ReportServer
# dataset_type_mapping is fixed mapping of Power BI datasources type to equivalent Datahub "data platform" dataset
dataset_type_mapping:
alcoccoque marked this conversation as resolved.
Show resolved Hide resolved
PostgreSql: postgres
Oracle: oracle
sink:
# sink configs
20 changes: 20 additions & 0 deletions metadata-ingestion/examples/mce_files/data_platforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,26 @@
},
"proposedDelta": null
},
{
"auditHeader": null,
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": {
"urn": "urn:li:dataPlatform:powerbi-report-server",
"aspects": [
{
"com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": {
"datasetNameDelimiter": ".",
"name": "powerbi-report-server",
"displayName": "Power BI Report Server",
"type": "OTHERS",
"logoUrl": "/assets/platforms/powerbireportserverlogo.png"
}
}
]
}
},
"proposedDelta": null
},
{
"auditHeader": null,
"proposedSnapshot": {
Expand Down
5 changes: 5 additions & 0 deletions metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def get_long_description():
"deltalake",
}

powerbi_report_server = {"requests", "requests_ntlm"}

usage_common = {
"sqlparse",
}
Expand Down Expand Up @@ -282,6 +284,7 @@ def get_long_description():
"starburst-trino-usage": sql_common | usage_common | trino,
"nifi": {"requests", "packaging"},
"powerbi": {"orderedset"} | microsoft_common,
"powerbi-report-server": {"orderedset"} | powerbi_report_server,
"vertica": sql_common | {"sqlalchemy-vertica[vertica-python]==0.0.5"},
}

Expand Down Expand Up @@ -366,6 +369,7 @@ def get_long_description():
"hive",
"starburst-trino-usage",
"powerbi",
"powerbi-report-server",
"vertica",
"salesforce"
# airflow is added below
Expand Down Expand Up @@ -507,6 +511,7 @@ def get_long_description():
"starburst-trino-usage = datahub.ingestion.source.usage.starburst_trino_usage:TrinoUsageSource",
"nifi = datahub.ingestion.source.nifi:NifiSource",
"powerbi = datahub.ingestion.source.powerbi:PowerBiDashboardSource",
"powerbi-report-server = datahub.ingestion.source.powerbi_report_server:PowerBiReportServerDashboardSource",
"iceberg = datahub.ingestion.source.iceberg.iceberg:IcebergSource",
"vertica = datahub.ingestion.source.sql.vertica:VerticaSource",
"presto-on-hive = datahub.ingestion.source.sql.presto_on_hive:PrestoOnHiveSource",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from datahub.ingestion.source.powerbi_report_server.report_server import (
PowerBiReportServerDashboardSource,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from enum import Enum


class CreatedFrom(Enum):
REPORT = "Report"
DATASET = "Dataset"
VISUALIZATION = "Visualization"
UNKNOWN = "Unknown"


class RelationshipDirection(Enum):
INCOMING = "INCOMING"
OUTGOING = "OUTGOING"


class Constant:
"""
keys used in powerbi plugin
"""

DATASET = "DATASET"
REPORTS = "REPORTS"
REPORT = "REPORT"
REPORT_DATASOURCES = "REPORT_DATASOURCES"
TYPE_REPORT = "Report"
DATASOURCE = "DATASOURCE"
DATASET_DATASOURCES = "DATASET_DATASOURCES"
DatasetId = "DatasetId"
ReportId = "ReportId"
PowerBiReportId = "ReportId"
Dataset_URN = "DatasetURN"
DASHBOARD_ID = "powerbi.linkedin.com/dashboards/{}"
DASHBOARD = "dashboard"
DATASETS = "DATASETS"
DATASET_ID = "powerbi.linkedin.com/datasets/{}"
DATASET_PROPERTIES = "datasetProperties"
SUBSCRIPTION = "SUBSCRIPTION"
SYSTEM = "SYSTEM"
CATALOG_ITEM = "CATALOG_ITEM"
EXCEL_WORKBOOK = "EXCEL_WORKBOOK"
EXTENSIONS = "EXTENSIONS"
FAVORITE_ITEM = "FAVORITE_ITEM"
FOLDERS = "FOLDERS"
KPIS = "KPIS"
LINKED_REPORTS = "LINKED_REPORTS"
LINKED_REPORT = "LINKED_REPORT"
ME = "ME"
MOBILE_REPORTS = "MOBILE_REPORTS"
MOBILE_REPORT = "MOBILE_REPORT"
POWERBI_REPORTS = "POWERBI_REPORTS"
POWERBI_REPORT = "POWERBI_REPORT"
POWERBI_REPORT_DATASOURCES = "POWERBI_REPORT_DATASOURCES"
TYPE_POWERBI_REPORT = "PowerBIReport"
RESOURCE = "RESOURCE"
SESSION = "SESSION"
SYSTEM_POLICIES = "SYSTEM_POLICIES"
DATASET_KEY = "datasetKey"
BROWSERPATH = "browsePaths"
DATAPLATFORM_INSTANCE = "dataPlatformInstance"
STATUS = "status"
VALUE = "value"
ID = "ID"
DASHBOARD_INFO = "dashboardInfo"
DASHBOARD_KEY = "dashboardKey"
CORP_USER = "corpuser"
CORP_USER_INFO = "corpUserInfo"
OWNERSHIP = "ownership"
CORP_USER_KEY = "corpUserKey"


API_ENDPOINTS = {
Constant.CATALOG_ITEM: "{PBIRS_BASE_URL}/CatalogItems({CATALOG_ID})",
Constant.DATASETS: "{PBIRS_BASE_URL}/Datasets",
Constant.DATASET: "{PBIRS_BASE_URL}/Datasets({DATASET_ID})",
Constant.DATASET_DATASOURCES: "{PBIRS_BASE_URL}/Datasets({DATASET_ID})/DataSources",
Constant.DATASOURCE: "{PBIRS_BASE_URL}/DataSources({DATASOURCE_ID})",
Constant.EXCEL_WORKBOOK: "{PBIRS_BASE_URL}/ExcelWorkbooks({EXCEL_WORKBOOK_ID})",
Constant.EXTENSIONS: "{PBIRS_BASE_URL}/Extensions",
Constant.FAVORITE_ITEM: "{PBIRS_BASE_URL}/FavoriteItems({FAVORITE_ITEM_ID})",
Constant.FOLDERS: "{PBIRS_BASE_URL}/Folders({FOLDER_ID})",
Constant.KPIS: "{PBIRS_BASE_URL}/Kpis({KPI_ID})",
Constant.LINKED_REPORTS: "{PBIRS_BASE_URL}/LinkedReports",
Constant.LINKED_REPORT: "{PBIRS_BASE_URL}/LinkedReports({LINKED_REPORT_ID})",
Constant.ME: "{PBIRS_BASE_URLL}/Me",
Constant.MOBILE_REPORTS: "{PBIRS_BASE_URL}/MobileReports",
Constant.MOBILE_REPORT: "{PBIRS_BASE_URL}/MobileReports({MOBILE_REPORT_ID})",
Constant.POWERBI_REPORTS: "{PBIRS_BASE_URL}/PowerBiReports",
Constant.POWERBI_REPORT: "{PBIRS_BASE_URL}/PowerBiReports({POWERBI_REPORT_ID})",
Constant.POWERBI_REPORT_DATASOURCES: "{PBIRS_BASE_URL}/PowerBiReports({ID})/DataSources",
Constant.REPORTS: "{PBIRS_BASE_URL}/Reports",
Constant.REPORT: "{PBIRS_BASE_URL}/Reports({REPORT_ID})",
Constant.REPORT_DATASOURCES: "{PBIRS_BASE_URL}/Reports({ID})/DataSources",
Constant.RESOURCE: "{PBIRS_BASE_URL}/Resources({RESOURCE_GET})",
Constant.SESSION: "{PBIRS_BASE_URL}/Session",
Constant.SUBSCRIPTION: "{PBIRS_BASE_URL}/Subscriptions({SUBSCRIPTION_ID})",
Constant.SYSTEM: "{PBIRS_BASE_URL}/System",
Constant.SYSTEM_POLICIES: "{PBIRS_BASE_URL}/System/Policies",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel, Field

from .constants import RelationshipDirection


class CorpUserEditableInfo(BaseModel):
display_name: str = Field(alias="displayName")
title: str
about_me: Optional[str] = Field(alias="aboutMe")
teams: Optional[List[str]]
skills: Optional[List[str]]
picture_link: Optional[str] = Field(alias="pictureLink")


class CorpUserEditableProperties(CorpUserEditableInfo):
slack: Optional[str]
phone: Optional[str]
email: str


class CorpUserStatus(BaseModel):
active: bool


class GlobalTags(BaseModel):
tags: List[str]


class EntityRelationship(BaseModel):
type: str
direction: RelationshipDirection
entity: str
created: datetime


class EntityRelationshipsResult(BaseModel):
start: int
count: int
total: int
relationships: Optional[EntityRelationship]


class CorpUserProperties(BaseModel):
active: bool
display_name: str = Field(alias="displayName")
email: str
title: Optional[str]
manager: Optional["CorpUser"]
department_id: Optional[int] = Field(alias="departmentId")
department_name: Optional[str] = Field(alias="departmentName")
first_name: Optional[str] = Field(alias="firstName")
last_name: Optional[str] = Field(alias="lastName")
full_name: Optional[str] = Field(alias="fullName")
country_code: Optional[str] = Field(alias="countryCode")


class CorpUser(BaseModel):
urn: str
type: str
username: str
properties: CorpUserProperties
editable_properties: Optional[CorpUserEditableProperties] = Field(
alias="editableProperties"
)
status: Optional[CorpUserStatus]
tags: Optional[GlobalTags]
relationships: Optional[EntityRelationshipsResult]
editableInfo: Optional[CorpUserEditableInfo] = Field(alias="editableInfo")
global_tags: Optional[GlobalTags] = Field(alias="globalTags")

def get_urn_part(self):
return "{}".format(self.username)

def __members(self):
return (self.username,)

def __eq__(self, instance):
return (
isinstance(instance, CorpUser) and self.__members() == instance.__members()
)

def __hash__(self):
return hash(self.__members())


CorpUserProperties.update_forward_refs()
Loading