mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-19 12:53:28 +00:00
fix(ingest/bigquery): use email as user urn (#13831)
This commit is contained in:
parent
dbcbca9a38
commit
b3a25d6fbd
@ -63,7 +63,7 @@ class BigQueryIdentifierBuilder:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def gen_user_urn(self, user_email: str) -> str:
|
def gen_user_urn(self, user_email: str) -> str:
|
||||||
return make_user_urn(user_email.split("@")[0])
|
return make_user_urn(user_email)
|
||||||
|
|
||||||
def make_data_platform_urn(self) -> str:
|
def make_data_platform_urn(self) -> str:
|
||||||
return make_data_platform_urn(self.platform)
|
return make_data_platform_urn(self.platform)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"created": {
|
"created": {
|
||||||
"time": 1643871600000,
|
"time": 1643871600000,
|
||||||
"actor": "urn:li:corpuser:foo"
|
"actor": "urn:li:corpuser:foo@xyz.com"
|
||||||
},
|
},
|
||||||
"dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,project-id-1.bigquery-dataset-1.table-1,PROD)",
|
"dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,project-id-1.bigquery-dataset-1.table-1,PROD)",
|
||||||
"type": "TRANSFORMED",
|
"type": "TRANSFORMED",
|
||||||
@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"systemMetadata": {
|
"systemMetadata": {
|
||||||
"lastObserved": 1643871600000,
|
"lastObserved": 1643871600000,
|
||||||
"runId": "bigquery-2022_02_03-07_00_00-6mhnuz",
|
"runId": "bigquery-2022_02_03-07_00_00-pj1cgp",
|
||||||
"lastRunId": "no-run-id-provided"
|
"lastRunId": "no-run-id-provided"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -117,7 +117,7 @@
|
|||||||
"uniqueUserCount": 1,
|
"uniqueUserCount": 1,
|
||||||
"userCounts": [
|
"userCounts": [
|
||||||
{
|
{
|
||||||
"user": "urn:li:corpuser:foo",
|
"user": "urn:li:corpuser:foo@xyz.com",
|
||||||
"count": 2
|
"count": 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -125,7 +125,7 @@
|
|||||||
},
|
},
|
||||||
"systemMetadata": {
|
"systemMetadata": {
|
||||||
"lastObserved": 1643871600000,
|
"lastObserved": 1643871600000,
|
||||||
"runId": "bigquery-2022_02_03-07_00_00-6mhnuz",
|
"runId": "bigquery-2022_02_03-07_00_00-pj1cgp",
|
||||||
"lastRunId": "no-run-id-provided"
|
"lastRunId": "no-run-id-provided"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -153,8 +153,9 @@
|
|||||||
],
|
],
|
||||||
"userCounts": [
|
"userCounts": [
|
||||||
{
|
{
|
||||||
"user": "urn:li:corpuser:foo",
|
"user": "urn:li:corpuser:foo@xyz.com",
|
||||||
"count": 4
|
"count": 4,
|
||||||
|
"userEmail": "foo@xyz.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"fieldCounts": []
|
"fieldCounts": []
|
||||||
@ -162,7 +163,7 @@
|
|||||||
},
|
},
|
||||||
"systemMetadata": {
|
"systemMetadata": {
|
||||||
"lastObserved": 1643871600000,
|
"lastObserved": 1643871600000,
|
||||||
"runId": "bigquery-2022_02_03-07_00_00-6mhnuz",
|
"runId": "bigquery-2022_02_03-07_00_00-pj1cgp",
|
||||||
"lastRunId": "no-run-id-provided"
|
"lastRunId": "no-run-id-provided"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -214,7 +215,7 @@
|
|||||||
"partition": "FULL_TABLE_SNAPSHOT",
|
"partition": "FULL_TABLE_SNAPSHOT",
|
||||||
"type": "FULL_TABLE"
|
"type": "FULL_TABLE"
|
||||||
},
|
},
|
||||||
"actor": "urn:li:corpuser:foo",
|
"actor": "urn:li:corpuser:foo@xyz.com",
|
||||||
"operationType": "CREATE",
|
"operationType": "CREATE",
|
||||||
"sourceType": "DATA_PLATFORM",
|
"sourceType": "DATA_PLATFORM",
|
||||||
"lastUpdatedTimestamp": 1643871600000,
|
"lastUpdatedTimestamp": 1643871600000,
|
||||||
@ -225,7 +226,7 @@
|
|||||||
},
|
},
|
||||||
"systemMetadata": {
|
"systemMetadata": {
|
||||||
"lastObserved": 1643871600000,
|
"lastObserved": 1643871600000,
|
||||||
"runId": "bigquery-2022_02_03-07_00_00-6mhnuz",
|
"runId": "bigquery-2022_02_03-07_00_00-pj1cgp",
|
||||||
"lastRunId": "no-run-id-provided"
|
"lastRunId": "no-run-id-provided"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -314,7 +315,7 @@
|
|||||||
"uniqueUserCount": 1,
|
"uniqueUserCount": 1,
|
||||||
"userCounts": [
|
"userCounts": [
|
||||||
{
|
{
|
||||||
"user": "urn:li:corpuser:foo",
|
"user": "urn:li:corpuser:foo@xyz.com",
|
||||||
"count": 2
|
"count": 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -322,7 +323,7 @@
|
|||||||
},
|
},
|
||||||
"systemMetadata": {
|
"systemMetadata": {
|
||||||
"lastObserved": 1643871600000,
|
"lastObserved": 1643871600000,
|
||||||
"runId": "bigquery-2022_02_03-07_00_00-6mhnuz",
|
"runId": "bigquery-2022_02_03-07_00_00-pj1cgp",
|
||||||
"lastRunId": "no-run-id-provided"
|
"lastRunId": "no-run-id-provided"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1061,7 +1061,7 @@ def test_operational_stats(
|
|||||||
OperationClass(
|
OperationClass(
|
||||||
timestampMillis=int(FROZEN_TIME.timestamp() * 1000),
|
timestampMillis=int(FROZEN_TIME.timestamp() * 1000),
|
||||||
lastUpdatedTimestamp=int(query.timestamp.timestamp() * 1000),
|
lastUpdatedTimestamp=int(query.timestamp.timestamp() * 1000),
|
||||||
actor=f"urn:li:corpuser:{query.actor.split('@')[0]}",
|
actor=f"urn:li:corpuser:{query.actor}",
|
||||||
operationType=(
|
operationType=(
|
||||||
query.type
|
query.type
|
||||||
if query.type in OPERATION_STATEMENT_TYPES.values()
|
if query.type in OPERATION_STATEMENT_TYPES.values()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user