Skip to content

Commit

Permalink
fix test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-acryl committed Oct 4, 2024
1 parent 08843b9 commit c365fad
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,33 +182,7 @@
"aspect": {
"json": {
"typeNames": [
"PowerBI Dataset Table",
"View"
]
}
},
"systemMetadata": {
"lastObserved": 1643871600000,
"runId": "powerbi-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.dbo_book_issue,DEV)",
"changeType": "UPSERT",
"aspectName": "upstreamLineage",
"aspect": {
"json": {
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.library.dbo.book_issue,PROD)",
"type": "TRANSFORMED"
}
"Table"
]
}
},
Expand Down Expand Up @@ -354,12 +328,21 @@
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.ms_sql_native_table,DEV)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.dbo_book_issue,DEV)",
"changeType": "UPSERT",
"aspectName": "status",
"aspectName": "upstreamLineage",
"aspect": {
"json": {
"removed": false
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.library.dbo.book_issue,PROD)",
"type": "TRANSFORMED"
}
]
}
},
"systemMetadata": {
Expand All @@ -372,13 +355,10 @@
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.ms_sql_native_table,DEV)",
"changeType": "UPSERT",
"aspectName": "subTypes",
"aspectName": "status",
"aspect": {
"json": {
"typeNames": [
"PowerBI Dataset Table",
"View"
]
"removed": false
}
},
"systemMetadata": {
Expand All @@ -391,18 +371,11 @@
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.ms_sql_native_table,DEV)",
"changeType": "UPSERT",
"aspectName": "upstreamLineage",
"aspectName": "subTypes",
"aspect": {
"json": {
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.COMMOPSDB.dbo.V_PS_CD_RETENTION,PROD)",
"type": "TRANSFORMED"
}
"typeNames": [
"Table"
]
}
},
Expand Down Expand Up @@ -600,12 +573,21 @@
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.revenue,DEV)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.ms_sql_native_table,DEV)",
"changeType": "UPSERT",
"aspectName": "status",
"aspectName": "upstreamLineage",
"aspect": {
"json": {
"removed": false
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.COMMOPSDB.dbo.V_PS_CD_RETENTION,PROD)",
"type": "TRANSFORMED"
}
]
}
},
"systemMetadata": {
Expand All @@ -618,13 +600,10 @@
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.revenue,DEV)",
"changeType": "UPSERT",
"aspectName": "subTypes",
"aspectName": "status",
"aspect": {
"json": {
"typeNames": [
"PowerBI Dataset Table",
"View"
]
"removed": false
}
},
"systemMetadata": {
Expand All @@ -637,18 +616,11 @@
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.revenue,DEV)",
"changeType": "UPSERT",
"aspectName": "upstreamLineage",
"aspectName": "subTypes",
"aspect": {
"json": {
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.analytics.analytics.sales_revenue,PROD)",
"type": "TRANSFORMED"
}
"typeNames": [
"Table"
]
}
},
Expand Down Expand Up @@ -819,6 +791,31 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:powerbi,hr_pbi_test.revenue,DEV)",
"changeType": "UPSERT",
"aspectName": "upstreamLineage",
"aspect": {
"json": {
"upstreams": [
{
"auditStamp": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
},
"dataset": "urn:li:dataset:(urn:li:dataPlatform:mssql,reporting-db.analytics.analytics.sales_revenue,PROD)",
"type": "TRANSFORMED"
}
]
}
},
"systemMetadata": {
"lastObserved": 1643871600000,
"runId": "powerbi-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "chart",
"entityUrn": "urn:li:chart:(powerbi,charts.B8E293DC-0C83-4AA0-9BB9-0A8738DF24A0)",
Expand Down Expand Up @@ -907,7 +904,7 @@
"aspect": {
"json": {
"typeNames": [
"PowerBI Tile"
"Tile"
]
}
},
Expand Down Expand Up @@ -1095,7 +1092,7 @@
"aspect": {
"json": {
"typeNames": [
"PowerBI Tile"
"Tile"
]
}
},
Expand Down Expand Up @@ -1395,7 +1392,7 @@
"aspect": {
"json": {
"typeNames": [
"PowerBI Dataset"
"Semantic Model"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"json": {
"timestampMillis": 1645599600000,
"partitionSpec": {
"type": "FULL_TABLE",
"partition": "FULL_TABLE_SNAPSHOT"
"partition": "FULL_TABLE_SNAPSHOT",
"type": "FULL_TABLE"
},
"rowCount": 542300,
"columnCount": 4,
Expand Down Expand Up @@ -115,8 +115,7 @@
"aspect": {
"json": {
"typeNames": [
"PowerBI Dataset Table",
"View"
"Table"
]
}
},
Expand Down
12 changes: 10 additions & 2 deletions metadata-ingestion/tests/integration/powerbi/test_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,28 @@ def register_mock_admin_api(request_mock: Any, override_data: dict = {}) -> None
"status_code": 200,
"json": admin_datasets_response,
},
"https://api.powerbi.com/v1.0/myorg/groups?%24top=1000&%24skip=0&%24filter=type+eq+%27Workspace%27": {
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=0&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
"@odata.count": 3,
"value": [
{
"id": "64ED5CAD-7C10-4684-8180-826122881108",
"isReadOnly": True,
"name": "demo-workspace",
"type": "Workspace",
"state": "Active",
}
],
},
},
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=1000&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
"value": [],
},
},
"https://api.powerbi.com/v1.0/myorg/groups/64ED5CAD-7C10-4684-8180-826122881108/dashboards": {
"method": "GET",
"status_code": 200,
Expand Down Expand Up @@ -176,6 +183,7 @@ def register_mock_admin_api(request_mock: Any, override_data: dict = {}) -> None
"id": "64ED5CAD-7C10-4684-8180-826122881108",
"name": "demo-workspace",
"state": "Active",
"type": "Workspace",
"datasets": [
{
"id": "05169CD2-E713-41E6-9600-1D8066D95445",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,35 @@ def register_mock_api_state1(request_mock):
"status_code": 403,
"json": {},
},
"https://api.powerbi.com/v1.0/myorg/groups": {
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=0&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
"@odata.count": 1,
"value": [
{
"id": "64ED5CAD-7C10-4684-8180-826122881108",
"isReadOnly": True,
"name": "Workspace 1",
"type": "Workspace",
"state": "Active",
},
{
"id": "44444444-7C10-4684-8180-826122881108",
"isReadOnly": True,
"name": "Multi Workspace",
"type": "Workspace",
"state": "Active",
},
],
},
},
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=1000&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
"value": [],
},
},
"https://api.powerbi.com/v1.0/myorg/groups/64ED5CAD-7C10-4684-8180-826122881108/dashboards": {
"method": "GET",
"status_code": 200,
Expand Down Expand Up @@ -114,7 +122,7 @@ def register_mock_api_state2(request_mock):
"status_code": 403,
"json": {},
},
"https://api.powerbi.com/v1.0/myorg/groups": {
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=0&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
Expand All @@ -135,6 +143,13 @@ def register_mock_api_state2(request_mock):
],
},
},
"https://api.powerbi.com/v1.0/myorg/groups?%24skip=1000&%24top=1000": {
"method": "GET",
"status_code": 200,
"json": {
"value": [],
},
},
"https://api.powerbi.com/v1.0/myorg/groups/64ED5CAD-7C10-4684-8180-826122881108/dashboards": {
"method": "GET",
"status_code": 200,
Expand Down

0 comments on commit c365fad

Please sign in to comment.