acryl-datahub 0.15.0rc16__py3-none-any.whl → 0.15.0rc18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of acryl-datahub might be problematic. Click here for more details.
- {acryl_datahub-0.15.0rc16.dist-info → acryl_datahub-0.15.0rc18.dist-info}/METADATA +2319 -2319
- {acryl_datahub-0.15.0rc16.dist-info → acryl_datahub-0.15.0rc18.dist-info}/RECORD +34 -32
- datahub/__init__.py +1 -1
- datahub/api/entities/structuredproperties/structuredproperties.py +7 -5
- datahub/cli/delete_cli.py +66 -20
- datahub/configuration/common.py +3 -3
- datahub/ingestion/api/source.py +5 -1
- datahub/ingestion/reporting/datahub_ingestion_run_summary_provider.py +2 -2
- datahub/ingestion/run/pipeline.py +1 -1
- datahub/ingestion/run/pipeline_config.py +6 -0
- datahub/ingestion/source/kafka/kafka.py +18 -11
- datahub/ingestion/source/looker/lookml_concept_context.py +1 -2
- datahub/ingestion/source/looker/view_upstream.py +65 -30
- datahub/ingestion/source/metadata/business_glossary.py +35 -18
- datahub/ingestion/source/snowflake/snowflake_query.py +6 -2
- datahub/ingestion/source/snowflake/snowflake_report.py +1 -0
- datahub/ingestion/source/snowflake/snowflake_schema.py +12 -0
- datahub/ingestion/source/snowflake/snowflake_schema_gen.py +17 -2
- datahub/ingestion/source/snowflake/snowflake_utils.py +45 -5
- datahub/ingestion/source/state/redundant_run_skip_handler.py +1 -1
- datahub/ingestion/source/tableau/tableau.py +35 -16
- datahub/ingestion/source/tableau/tableau_common.py +0 -1
- datahub/metadata/_schema_classes.py +122 -2
- datahub/metadata/com/linkedin/pegasus2avro/structured/__init__.py +2 -0
- datahub/metadata/schema.avsc +73 -1
- datahub/metadata/schemas/StructuredPropertyDefinition.avsc +1 -1
- datahub/metadata/schemas/StructuredPropertyKey.avsc +1 -0
- datahub/metadata/schemas/StructuredPropertySettings.avsc +114 -0
- datahub/sql_parsing/schema_resolver.py +23 -0
- datahub/sql_parsing/sqlglot_lineage.py +48 -13
- datahub/testing/doctest.py +12 -0
- {acryl_datahub-0.15.0rc16.dist-info → acryl_datahub-0.15.0rc18.dist-info}/WHEEL +0 -0
- {acryl_datahub-0.15.0rc16.dist-info → acryl_datahub-0.15.0rc18.dist-info}/entry_points.txt +0 -0
- {acryl_datahub-0.15.0rc16.dist-info → acryl_datahub-0.15.0rc18.dist-info}/top_level.txt +0 -0
|
@@ -23267,7 +23267,7 @@ class StructuredPropertyDefinitionClass(_Aspect):
|
|
|
23267
23267
|
|
|
23268
23268
|
@property
|
|
23269
23269
|
def lastModified(self) -> Union[None, "AuditStampClass"]:
|
|
23270
|
-
"""
|
|
23270
|
+
"""Last Modified Audit stamp"""
|
|
23271
23271
|
return self._inner_dict.get('lastModified') # type: ignore
|
|
23272
23272
|
|
|
23273
23273
|
@lastModified.setter
|
|
@@ -23280,7 +23280,7 @@ class StructuredPropertyKeyClass(_Aspect):
|
|
|
23280
23280
|
|
|
23281
23281
|
|
|
23282
23282
|
ASPECT_NAME = 'structuredPropertyKey'
|
|
23283
|
-
ASPECT_INFO = {'keyForEntity': 'structuredProperty', 'entityCategory': 'core', 'entityAspects': ['propertyDefinition', 'institutionalMemory', 'status'], 'entityDoc': 'Structured Property represents a property meant for extending the core model of a logical entity'}
|
|
23283
|
+
ASPECT_INFO = {'keyForEntity': 'structuredProperty', 'entityCategory': 'core', 'entityAspects': ['propertyDefinition', 'structuredPropertySettings', 'institutionalMemory', 'status'], 'entityDoc': 'Structured Property represents a property meant for extending the core model of a logical entity'}
|
|
23284
23284
|
RECORD_SCHEMA = get_schema_type("com.linkedin.pegasus2avro.structured.StructuredPropertyKey")
|
|
23285
23285
|
|
|
23286
23286
|
def __init__(self,
|
|
@@ -23304,6 +23304,122 @@ class StructuredPropertyKeyClass(_Aspect):
|
|
|
23304
23304
|
self._inner_dict['id'] = value
|
|
23305
23305
|
|
|
23306
23306
|
|
|
23307
|
+
class StructuredPropertySettingsClass(_Aspect):
|
|
23308
|
+
"""Settings specific to a structured property entity"""
|
|
23309
|
+
|
|
23310
|
+
|
|
23311
|
+
ASPECT_NAME = 'structuredPropertySettings'
|
|
23312
|
+
ASPECT_INFO = {}
|
|
23313
|
+
RECORD_SCHEMA = get_schema_type("com.linkedin.pegasus2avro.structured.StructuredPropertySettings")
|
|
23314
|
+
|
|
23315
|
+
def __init__(self,
|
|
23316
|
+
isHidden: Optional[bool]=None,
|
|
23317
|
+
showInSearchFilters: Optional[bool]=None,
|
|
23318
|
+
showInAssetSummary: Optional[bool]=None,
|
|
23319
|
+
showAsAssetBadge: Optional[bool]=None,
|
|
23320
|
+
showInColumnsTable: Optional[bool]=None,
|
|
23321
|
+
lastModified: Union[None, "AuditStampClass"]=None,
|
|
23322
|
+
):
|
|
23323
|
+
super().__init__()
|
|
23324
|
+
|
|
23325
|
+
if isHidden is None:
|
|
23326
|
+
# default: False
|
|
23327
|
+
self.isHidden = self.RECORD_SCHEMA.fields_dict["isHidden"].default
|
|
23328
|
+
else:
|
|
23329
|
+
self.isHidden = isHidden
|
|
23330
|
+
if showInSearchFilters is None:
|
|
23331
|
+
# default: False
|
|
23332
|
+
self.showInSearchFilters = self.RECORD_SCHEMA.fields_dict["showInSearchFilters"].default
|
|
23333
|
+
else:
|
|
23334
|
+
self.showInSearchFilters = showInSearchFilters
|
|
23335
|
+
if showInAssetSummary is None:
|
|
23336
|
+
# default: False
|
|
23337
|
+
self.showInAssetSummary = self.RECORD_SCHEMA.fields_dict["showInAssetSummary"].default
|
|
23338
|
+
else:
|
|
23339
|
+
self.showInAssetSummary = showInAssetSummary
|
|
23340
|
+
if showAsAssetBadge is None:
|
|
23341
|
+
# default: False
|
|
23342
|
+
self.showAsAssetBadge = self.RECORD_SCHEMA.fields_dict["showAsAssetBadge"].default
|
|
23343
|
+
else:
|
|
23344
|
+
self.showAsAssetBadge = showAsAssetBadge
|
|
23345
|
+
if showInColumnsTable is None:
|
|
23346
|
+
# default: False
|
|
23347
|
+
self.showInColumnsTable = self.RECORD_SCHEMA.fields_dict["showInColumnsTable"].default
|
|
23348
|
+
else:
|
|
23349
|
+
self.showInColumnsTable = showInColumnsTable
|
|
23350
|
+
self.lastModified = lastModified
|
|
23351
|
+
|
|
23352
|
+
def _restore_defaults(self) -> None:
|
|
23353
|
+
self.isHidden = self.RECORD_SCHEMA.fields_dict["isHidden"].default
|
|
23354
|
+
self.showInSearchFilters = self.RECORD_SCHEMA.fields_dict["showInSearchFilters"].default
|
|
23355
|
+
self.showInAssetSummary = self.RECORD_SCHEMA.fields_dict["showInAssetSummary"].default
|
|
23356
|
+
self.showAsAssetBadge = self.RECORD_SCHEMA.fields_dict["showAsAssetBadge"].default
|
|
23357
|
+
self.showInColumnsTable = self.RECORD_SCHEMA.fields_dict["showInColumnsTable"].default
|
|
23358
|
+
self.lastModified = self.RECORD_SCHEMA.fields_dict["lastModified"].default
|
|
23359
|
+
|
|
23360
|
+
|
|
23361
|
+
@property
|
|
23362
|
+
def isHidden(self) -> bool:
|
|
23363
|
+
"""Whether or not this asset should be hidden in the main application"""
|
|
23364
|
+
return self._inner_dict.get('isHidden') # type: ignore
|
|
23365
|
+
|
|
23366
|
+
@isHidden.setter
|
|
23367
|
+
def isHidden(self, value: bool) -> None:
|
|
23368
|
+
self._inner_dict['isHidden'] = value
|
|
23369
|
+
|
|
23370
|
+
|
|
23371
|
+
@property
|
|
23372
|
+
def showInSearchFilters(self) -> bool:
|
|
23373
|
+
"""Whether or not this asset should be displayed as a search filter"""
|
|
23374
|
+
return self._inner_dict.get('showInSearchFilters') # type: ignore
|
|
23375
|
+
|
|
23376
|
+
@showInSearchFilters.setter
|
|
23377
|
+
def showInSearchFilters(self, value: bool) -> None:
|
|
23378
|
+
self._inner_dict['showInSearchFilters'] = value
|
|
23379
|
+
|
|
23380
|
+
|
|
23381
|
+
@property
|
|
23382
|
+
def showInAssetSummary(self) -> bool:
|
|
23383
|
+
"""Whether or not this asset should be displayed in the asset sidebar"""
|
|
23384
|
+
return self._inner_dict.get('showInAssetSummary') # type: ignore
|
|
23385
|
+
|
|
23386
|
+
@showInAssetSummary.setter
|
|
23387
|
+
def showInAssetSummary(self, value: bool) -> None:
|
|
23388
|
+
self._inner_dict['showInAssetSummary'] = value
|
|
23389
|
+
|
|
23390
|
+
|
|
23391
|
+
@property
|
|
23392
|
+
def showAsAssetBadge(self) -> bool:
|
|
23393
|
+
"""Whether or not this asset should be displayed as an asset badge on other
|
|
23394
|
+
asset's headers"""
|
|
23395
|
+
return self._inner_dict.get('showAsAssetBadge') # type: ignore
|
|
23396
|
+
|
|
23397
|
+
@showAsAssetBadge.setter
|
|
23398
|
+
def showAsAssetBadge(self, value: bool) -> None:
|
|
23399
|
+
self._inner_dict['showAsAssetBadge'] = value
|
|
23400
|
+
|
|
23401
|
+
|
|
23402
|
+
@property
|
|
23403
|
+
def showInColumnsTable(self) -> bool:
|
|
23404
|
+
"""Whether or not this asset should be displayed as a column in the schema field table
|
|
23405
|
+
in a Dataset's "Columns" tab."""
|
|
23406
|
+
return self._inner_dict.get('showInColumnsTable') # type: ignore
|
|
23407
|
+
|
|
23408
|
+
@showInColumnsTable.setter
|
|
23409
|
+
def showInColumnsTable(self, value: bool) -> None:
|
|
23410
|
+
self._inner_dict['showInColumnsTable'] = value
|
|
23411
|
+
|
|
23412
|
+
|
|
23413
|
+
@property
|
|
23414
|
+
def lastModified(self) -> Union[None, "AuditStampClass"]:
|
|
23415
|
+
"""Last Modified Audit stamp"""
|
|
23416
|
+
return self._inner_dict.get('lastModified') # type: ignore
|
|
23417
|
+
|
|
23418
|
+
@lastModified.setter
|
|
23419
|
+
def lastModified(self, value: Union[None, "AuditStampClass"]) -> None:
|
|
23420
|
+
self._inner_dict['lastModified'] = value
|
|
23421
|
+
|
|
23422
|
+
|
|
23307
23423
|
class StructuredPropertyValueAssignmentClass(DictWrapper):
|
|
23308
23424
|
# No docs available.
|
|
23309
23425
|
|
|
@@ -24775,6 +24891,7 @@ __SCHEMA_TYPES = {
|
|
|
24775
24891
|
'com.linkedin.pegasus2avro.structured.StructuredProperties': StructuredPropertiesClass,
|
|
24776
24892
|
'com.linkedin.pegasus2avro.structured.StructuredPropertyDefinition': StructuredPropertyDefinitionClass,
|
|
24777
24893
|
'com.linkedin.pegasus2avro.structured.StructuredPropertyKey': StructuredPropertyKeyClass,
|
|
24894
|
+
'com.linkedin.pegasus2avro.structured.StructuredPropertySettings': StructuredPropertySettingsClass,
|
|
24778
24895
|
'com.linkedin.pegasus2avro.structured.StructuredPropertyValueAssignment': StructuredPropertyValueAssignmentClass,
|
|
24779
24896
|
'com.linkedin.pegasus2avro.tag.TagProperties': TagPropertiesClass,
|
|
24780
24897
|
'com.linkedin.pegasus2avro.telemetry.TelemetryClientId': TelemetryClientIdClass,
|
|
@@ -25240,6 +25357,7 @@ __SCHEMA_TYPES = {
|
|
|
25240
25357
|
'StructuredProperties': StructuredPropertiesClass,
|
|
25241
25358
|
'StructuredPropertyDefinition': StructuredPropertyDefinitionClass,
|
|
25242
25359
|
'StructuredPropertyKey': StructuredPropertyKeyClass,
|
|
25360
|
+
'StructuredPropertySettings': StructuredPropertySettingsClass,
|
|
25243
25361
|
'StructuredPropertyValueAssignment': StructuredPropertyValueAssignmentClass,
|
|
25244
25362
|
'TagProperties': TagPropertiesClass,
|
|
25245
25363
|
'TelemetryClientId': TelemetryClientIdClass,
|
|
@@ -25336,6 +25454,7 @@ ASPECT_CLASSES: List[Type[_Aspect]] = [
|
|
|
25336
25454
|
QuerySubjectsClass,
|
|
25337
25455
|
StructuredPropertyKeyClass,
|
|
25338
25456
|
StructuredPropertyDefinitionClass,
|
|
25457
|
+
StructuredPropertySettingsClass,
|
|
25339
25458
|
StructuredPropertiesClass,
|
|
25340
25459
|
GlobalSettingsInfoClass,
|
|
25341
25460
|
DataHubRetentionConfigClass,
|
|
@@ -25548,6 +25667,7 @@ class AspectBag(TypedDict, total=False):
|
|
|
25548
25667
|
querySubjects: QuerySubjectsClass
|
|
25549
25668
|
structuredPropertyKey: StructuredPropertyKeyClass
|
|
25550
25669
|
propertyDefinition: StructuredPropertyDefinitionClass
|
|
25670
|
+
structuredPropertySettings: StructuredPropertySettingsClass
|
|
25551
25671
|
structuredProperties: StructuredPropertiesClass
|
|
25552
25672
|
globalSettingsInfo: GlobalSettingsInfoClass
|
|
25553
25673
|
dataHubRetentionConfig: DataHubRetentionConfigClass
|
|
@@ -12,6 +12,7 @@ from .....schema_classes import PropertyValueClass
|
|
|
12
12
|
from .....schema_classes import StructuredPropertiesClass
|
|
13
13
|
from .....schema_classes import StructuredPropertyDefinitionClass
|
|
14
14
|
from .....schema_classes import StructuredPropertyKeyClass
|
|
15
|
+
from .....schema_classes import StructuredPropertySettingsClass
|
|
15
16
|
from .....schema_classes import StructuredPropertyValueAssignmentClass
|
|
16
17
|
|
|
17
18
|
|
|
@@ -20,6 +21,7 @@ PropertyValue = PropertyValueClass
|
|
|
20
21
|
StructuredProperties = StructuredPropertiesClass
|
|
21
22
|
StructuredPropertyDefinition = StructuredPropertyDefinitionClass
|
|
22
23
|
StructuredPropertyKey = StructuredPropertyKeyClass
|
|
24
|
+
StructuredPropertySettings = StructuredPropertySettingsClass
|
|
23
25
|
StructuredPropertyValueAssignment = StructuredPropertyValueAssignmentClass
|
|
24
26
|
|
|
25
27
|
# fmt: on
|
datahub/metadata/schema.avsc
CHANGED
|
@@ -2995,6 +2995,7 @@
|
|
|
2995
2995
|
"entityCategory": "core",
|
|
2996
2996
|
"entityAspects": [
|
|
2997
2997
|
"propertyDefinition",
|
|
2998
|
+
"structuredPropertySettings",
|
|
2998
2999
|
"institutionalMemory",
|
|
2999
3000
|
"status"
|
|
3000
3001
|
],
|
|
@@ -3328,10 +3329,81 @@
|
|
|
3328
3329
|
],
|
|
3329
3330
|
"name": "lastModified",
|
|
3330
3331
|
"default": null,
|
|
3331
|
-
"doc": "
|
|
3332
|
+
"doc": "Last Modified Audit stamp"
|
|
3332
3333
|
}
|
|
3333
3334
|
]
|
|
3334
3335
|
},
|
|
3336
|
+
{
|
|
3337
|
+
"type": "record",
|
|
3338
|
+
"Aspect": {
|
|
3339
|
+
"name": "structuredPropertySettings"
|
|
3340
|
+
},
|
|
3341
|
+
"name": "StructuredPropertySettings",
|
|
3342
|
+
"namespace": "com.linkedin.pegasus2avro.structured",
|
|
3343
|
+
"fields": [
|
|
3344
|
+
{
|
|
3345
|
+
"Searchable": {
|
|
3346
|
+
"fieldType": "BOOLEAN"
|
|
3347
|
+
},
|
|
3348
|
+
"type": "boolean",
|
|
3349
|
+
"name": "isHidden",
|
|
3350
|
+
"default": false,
|
|
3351
|
+
"doc": "Whether or not this asset should be hidden in the main application"
|
|
3352
|
+
},
|
|
3353
|
+
{
|
|
3354
|
+
"Searchable": {
|
|
3355
|
+
"fieldType": "BOOLEAN"
|
|
3356
|
+
},
|
|
3357
|
+
"type": "boolean",
|
|
3358
|
+
"name": "showInSearchFilters",
|
|
3359
|
+
"default": false,
|
|
3360
|
+
"doc": "Whether or not this asset should be displayed as a search filter"
|
|
3361
|
+
},
|
|
3362
|
+
{
|
|
3363
|
+
"Searchable": {
|
|
3364
|
+
"fieldType": "BOOLEAN"
|
|
3365
|
+
},
|
|
3366
|
+
"type": "boolean",
|
|
3367
|
+
"name": "showInAssetSummary",
|
|
3368
|
+
"default": false,
|
|
3369
|
+
"doc": "Whether or not this asset should be displayed in the asset sidebar"
|
|
3370
|
+
},
|
|
3371
|
+
{
|
|
3372
|
+
"Searchable": {
|
|
3373
|
+
"fieldType": "BOOLEAN"
|
|
3374
|
+
},
|
|
3375
|
+
"type": "boolean",
|
|
3376
|
+
"name": "showAsAssetBadge",
|
|
3377
|
+
"default": false,
|
|
3378
|
+
"doc": "Whether or not this asset should be displayed as an asset badge on other\nasset's headers"
|
|
3379
|
+
},
|
|
3380
|
+
{
|
|
3381
|
+
"Searchable": {
|
|
3382
|
+
"fieldType": "BOOLEAN"
|
|
3383
|
+
},
|
|
3384
|
+
"type": "boolean",
|
|
3385
|
+
"name": "showInColumnsTable",
|
|
3386
|
+
"default": false,
|
|
3387
|
+
"doc": "Whether or not this asset should be displayed as a column in the schema field table\nin a Dataset's \"Columns\" tab."
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
"Searchable": {
|
|
3391
|
+
"/time": {
|
|
3392
|
+
"fieldName": "lastModifiedSettings",
|
|
3393
|
+
"fieldType": "DATETIME"
|
|
3394
|
+
}
|
|
3395
|
+
},
|
|
3396
|
+
"type": [
|
|
3397
|
+
"null",
|
|
3398
|
+
"com.linkedin.pegasus2avro.common.AuditStamp"
|
|
3399
|
+
],
|
|
3400
|
+
"name": "lastModified",
|
|
3401
|
+
"default": null,
|
|
3402
|
+
"doc": "Last Modified Audit stamp"
|
|
3403
|
+
}
|
|
3404
|
+
],
|
|
3405
|
+
"doc": "Settings specific to a structured property entity"
|
|
3406
|
+
},
|
|
3335
3407
|
{
|
|
3336
3408
|
"type": "record",
|
|
3337
3409
|
"Aspect": {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "record",
|
|
3
|
+
"Aspect": {
|
|
4
|
+
"name": "structuredPropertySettings"
|
|
5
|
+
},
|
|
6
|
+
"name": "StructuredPropertySettings",
|
|
7
|
+
"namespace": "com.linkedin.pegasus2avro.structured",
|
|
8
|
+
"fields": [
|
|
9
|
+
{
|
|
10
|
+
"Searchable": {
|
|
11
|
+
"fieldType": "BOOLEAN"
|
|
12
|
+
},
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"name": "isHidden",
|
|
15
|
+
"default": false,
|
|
16
|
+
"doc": "Whether or not this asset should be hidden in the main application"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"Searchable": {
|
|
20
|
+
"fieldType": "BOOLEAN"
|
|
21
|
+
},
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"name": "showInSearchFilters",
|
|
24
|
+
"default": false,
|
|
25
|
+
"doc": "Whether or not this asset should be displayed as a search filter"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"Searchable": {
|
|
29
|
+
"fieldType": "BOOLEAN"
|
|
30
|
+
},
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"name": "showInAssetSummary",
|
|
33
|
+
"default": false,
|
|
34
|
+
"doc": "Whether or not this asset should be displayed in the asset sidebar"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"Searchable": {
|
|
38
|
+
"fieldType": "BOOLEAN"
|
|
39
|
+
},
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"name": "showAsAssetBadge",
|
|
42
|
+
"default": false,
|
|
43
|
+
"doc": "Whether or not this asset should be displayed as an asset badge on other\nasset's headers"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"Searchable": {
|
|
47
|
+
"fieldType": "BOOLEAN"
|
|
48
|
+
},
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"name": "showInColumnsTable",
|
|
51
|
+
"default": false,
|
|
52
|
+
"doc": "Whether or not this asset should be displayed as a column in the schema field table\nin a Dataset's \"Columns\" tab."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"Searchable": {
|
|
56
|
+
"/time": {
|
|
57
|
+
"fieldName": "lastModifiedSettings",
|
|
58
|
+
"fieldType": "DATETIME"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"type": [
|
|
62
|
+
"null",
|
|
63
|
+
{
|
|
64
|
+
"type": "record",
|
|
65
|
+
"name": "AuditStamp",
|
|
66
|
+
"namespace": "com.linkedin.pegasus2avro.common",
|
|
67
|
+
"fields": [
|
|
68
|
+
{
|
|
69
|
+
"type": "long",
|
|
70
|
+
"name": "time",
|
|
71
|
+
"doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"java": {
|
|
75
|
+
"class": "com.linkedin.pegasus2avro.common.urn.Urn"
|
|
76
|
+
},
|
|
77
|
+
"type": "string",
|
|
78
|
+
"name": "actor",
|
|
79
|
+
"doc": "The entity (e.g. a member URN) which will be credited for moving the resource/association/sub-resource into the specific lifecycle stage. It is also the one used to authorize the change.",
|
|
80
|
+
"Urn": "Urn"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"java": {
|
|
84
|
+
"class": "com.linkedin.pegasus2avro.common.urn.Urn"
|
|
85
|
+
},
|
|
86
|
+
"type": [
|
|
87
|
+
"null",
|
|
88
|
+
"string"
|
|
89
|
+
],
|
|
90
|
+
"name": "impersonator",
|
|
91
|
+
"default": null,
|
|
92
|
+
"doc": "The entity (e.g. a service URN) which performs the change on behalf of the Actor and must be authorized to act as the Actor.",
|
|
93
|
+
"Urn": "Urn"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": [
|
|
97
|
+
"null",
|
|
98
|
+
"string"
|
|
99
|
+
],
|
|
100
|
+
"name": "message",
|
|
101
|
+
"default": null,
|
|
102
|
+
"doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"doc": "Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage."
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"name": "lastModified",
|
|
109
|
+
"default": null,
|
|
110
|
+
"doc": "Last Modified Audit stamp"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"doc": "Settings specific to a structured property entity"
|
|
114
|
+
}
|
|
@@ -123,6 +123,13 @@ class SchemaResolver(Closeable, SchemaResolverInterface):
|
|
|
123
123
|
)
|
|
124
124
|
return urn
|
|
125
125
|
|
|
126
|
+
def resolve_urn(self, urn: str) -> Tuple[str, Optional[SchemaInfo]]:
|
|
127
|
+
schema_info = self._resolve_schema_info(urn)
|
|
128
|
+
if schema_info:
|
|
129
|
+
return urn, schema_info
|
|
130
|
+
|
|
131
|
+
return urn, None
|
|
132
|
+
|
|
126
133
|
def resolve_table(self, table: _TableName) -> Tuple[str, Optional[SchemaInfo]]:
|
|
127
134
|
urn = self.get_urn_for_table(table)
|
|
128
135
|
|
|
@@ -293,3 +300,19 @@ def _convert_schema_field_list_to_info(
|
|
|
293
300
|
|
|
294
301
|
def _convert_schema_aspect_to_info(schema_metadata: SchemaMetadataClass) -> SchemaInfo:
|
|
295
302
|
return _convert_schema_field_list_to_info(schema_metadata.fields)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def match_columns_to_schema(
|
|
306
|
+
schema_info: SchemaInfo, input_columns: List[str]
|
|
307
|
+
) -> List[str]:
|
|
308
|
+
column_from_gms: List[str] = list(schema_info.keys()) # list() to silent lint
|
|
309
|
+
|
|
310
|
+
gms_column_map: Dict[str, str] = {
|
|
311
|
+
column.lower(): column for column in column_from_gms
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
output_columns: List[str] = [
|
|
315
|
+
gms_column_map.get(column.lower(), column) for column in input_columns
|
|
316
|
+
]
|
|
317
|
+
|
|
318
|
+
return output_columns
|
|
@@ -1181,6 +1181,45 @@ def sqlglot_lineage(
|
|
|
1181
1181
|
)
|
|
1182
1182
|
|
|
1183
1183
|
|
|
1184
|
+
@functools.lru_cache(maxsize=128)
|
|
1185
|
+
def create_and_cache_schema_resolver(
|
|
1186
|
+
platform: str,
|
|
1187
|
+
env: str,
|
|
1188
|
+
graph: Optional[DataHubGraph] = None,
|
|
1189
|
+
platform_instance: Optional[str] = None,
|
|
1190
|
+
schema_aware: bool = True,
|
|
1191
|
+
) -> SchemaResolver:
|
|
1192
|
+
return create_schema_resolver(
|
|
1193
|
+
platform=platform,
|
|
1194
|
+
env=env,
|
|
1195
|
+
graph=graph,
|
|
1196
|
+
platform_instance=platform_instance,
|
|
1197
|
+
schema_aware=schema_aware,
|
|
1198
|
+
)
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
def create_schema_resolver(
|
|
1202
|
+
platform: str,
|
|
1203
|
+
env: str,
|
|
1204
|
+
graph: Optional[DataHubGraph] = None,
|
|
1205
|
+
platform_instance: Optional[str] = None,
|
|
1206
|
+
schema_aware: bool = True,
|
|
1207
|
+
) -> SchemaResolver:
|
|
1208
|
+
if graph and schema_aware:
|
|
1209
|
+
return graph._make_schema_resolver(
|
|
1210
|
+
platform=platform,
|
|
1211
|
+
platform_instance=platform_instance,
|
|
1212
|
+
env=env,
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
return SchemaResolver(
|
|
1216
|
+
platform=platform,
|
|
1217
|
+
platform_instance=platform_instance,
|
|
1218
|
+
env=env,
|
|
1219
|
+
graph=None,
|
|
1220
|
+
)
|
|
1221
|
+
|
|
1222
|
+
|
|
1184
1223
|
def create_lineage_sql_parsed_result(
|
|
1185
1224
|
query: str,
|
|
1186
1225
|
default_db: Optional[str],
|
|
@@ -1191,21 +1230,17 @@ def create_lineage_sql_parsed_result(
|
|
|
1191
1230
|
graph: Optional[DataHubGraph] = None,
|
|
1192
1231
|
schema_aware: bool = True,
|
|
1193
1232
|
) -> SqlParsingResult:
|
|
1233
|
+
schema_resolver = create_schema_resolver(
|
|
1234
|
+
platform=platform,
|
|
1235
|
+
platform_instance=platform_instance,
|
|
1236
|
+
env=env,
|
|
1237
|
+
schema_aware=schema_aware,
|
|
1238
|
+
graph=graph,
|
|
1239
|
+
)
|
|
1240
|
+
|
|
1241
|
+
needs_close: bool = True
|
|
1194
1242
|
if graph and schema_aware:
|
|
1195
1243
|
needs_close = False
|
|
1196
|
-
schema_resolver = graph._make_schema_resolver(
|
|
1197
|
-
platform=platform,
|
|
1198
|
-
platform_instance=platform_instance,
|
|
1199
|
-
env=env,
|
|
1200
|
-
)
|
|
1201
|
-
else:
|
|
1202
|
-
needs_close = True
|
|
1203
|
-
schema_resolver = SchemaResolver(
|
|
1204
|
-
platform=platform,
|
|
1205
|
-
platform_instance=platform_instance,
|
|
1206
|
-
env=env,
|
|
1207
|
-
graph=None,
|
|
1208
|
-
)
|
|
1209
1244
|
|
|
1210
1245
|
try:
|
|
1211
1246
|
return sqlglot_lineage(
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import doctest
|
|
2
|
+
from types import ModuleType
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def assert_doctest(module: ModuleType) -> None:
|
|
6
|
+
result = doctest.testmod(
|
|
7
|
+
module,
|
|
8
|
+
raise_on_error=True,
|
|
9
|
+
verbose=True,
|
|
10
|
+
)
|
|
11
|
+
if result.attempted == 0:
|
|
12
|
+
raise ValueError(f"No doctests found in {module.__name__}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|