acryl-datahub 1.2.0.1__py3-none-any.whl → 1.2.0.2rc1__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.

Files changed (27) hide show
  1. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/METADATA +2605 -2605
  2. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/RECORD +27 -27
  3. datahub/_version.py +1 -1
  4. datahub/emitter/rest_emitter.py +3 -1
  5. datahub/ingestion/source/abs/source.py +5 -29
  6. datahub/ingestion/source/data_lake_common/data_lake_utils.py +37 -0
  7. datahub/ingestion/source/dbt/dbt_common.py +69 -2
  8. datahub/ingestion/source/looker/looker_common.py +40 -4
  9. datahub/ingestion/source/s3/source.py +5 -33
  10. datahub/ingestion/source/sql/postgres.py +190 -1
  11. datahub/ingestion/source/sql_queries.py +112 -77
  12. datahub/metadata/_internal_schema_classes.py +81 -0
  13. datahub/metadata/com/linkedin/pegasus2avro/module/__init__.py +2 -0
  14. datahub/metadata/schema.avsc +60 -0
  15. datahub/metadata/schemas/CorpUserSettings.avsc +10 -1
  16. datahub/metadata/schemas/DataHubPageModuleProperties.avsc +33 -0
  17. datahub/metadata/schemas/MetadataChangeEvent.avsc +18 -0
  18. datahub/metadata/schemas/MetadataChangeLog.avsc +62 -44
  19. datahub/metadata/schemas/MetadataChangeProposal.avsc +61 -0
  20. datahub/metadata/schemas/SystemMetadata.avsc +61 -0
  21. datahub/sdk/search_filters.py +51 -2
  22. datahub/sql_parsing/sql_parsing_aggregator.py +1 -0
  23. datahub/upgrade/upgrade.py +5 -3
  24. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/WHEEL +0 -0
  25. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/entry_points.txt +0 -0
  26. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/licenses/LICENSE +0 -0
  27. {acryl_datahub-1.2.0.1.dist-info → acryl_datahub-1.2.0.2rc1.dist-info}/top_level.txt +0 -0
@@ -6120,10 +6120,19 @@
6120
6120
  "namespace": "com.linkedin.pegasus2avro.identity",
6121
6121
  "fields": [
6122
6122
  {
6123
+ "Relationship": {
6124
+ "entityTypes": [
6125
+ "dataHubPageTemplate"
6126
+ ],
6127
+ "name": "HasPersonalPageTemplate"
6128
+ },
6123
6129
  "java": {
6124
6130
  "class": "com.linkedin.pegasus2avro.common.urn.Urn"
6125
6131
  },
6126
6132
  "Urn": "Urn",
6133
+ "entityTypes": [
6134
+ "dataHubPageTemplate"
6135
+ ],
6127
6136
  "type": [
6128
6137
  "null",
6129
6138
  "string"
@@ -11543,6 +11552,24 @@
11543
11552
  "name": "version",
11544
11553
  "default": null,
11545
11554
  "doc": "Aspect version\n Initial implementation will use the aspect version's number, however stored as\n a string in the case where a different aspect versioning scheme is later adopted."
11555
+ },
11556
+ {
11557
+ "type": [
11558
+ "null",
11559
+ "com.linkedin.pegasus2avro.common.AuditStamp"
11560
+ ],
11561
+ "name": "aspectCreated",
11562
+ "default": null,
11563
+ "doc": "When the aspect was initially created and who created it, detected by version 0 -> 1 change"
11564
+ },
11565
+ {
11566
+ "type": [
11567
+ "null",
11568
+ "com.linkedin.pegasus2avro.common.AuditStamp"
11569
+ ],
11570
+ "name": "aspectModified",
11571
+ "default": null,
11572
+ "doc": "When the aspect was last modified and the actor that performed the modification"
11546
11573
  }
11547
11574
  ],
11548
11575
  "doc": "Metadata associated with each metadata change that is processed by the system"
@@ -17792,6 +17819,39 @@
17792
17819
  "name": "assetCollectionParams",
17793
17820
  "default": null,
17794
17821
  "doc": "The params required if the module is type ASSET_COLLECTION"
17822
+ },
17823
+ {
17824
+ "type": [
17825
+ "null",
17826
+ {
17827
+ "type": "record",
17828
+ "name": "HierarchyModuleParams",
17829
+ "namespace": "com.linkedin.pegasus2avro.module",
17830
+ "fields": [
17831
+ {
17832
+ "Urn": "Urn",
17833
+ "urn_is_array": true,
17834
+ "type": [
17835
+ "null",
17836
+ {
17837
+ "type": "array",
17838
+ "items": "string"
17839
+ }
17840
+ ],
17841
+ "name": "assetUrns",
17842
+ "default": null
17843
+ },
17844
+ {
17845
+ "type": "boolean",
17846
+ "name": "showRelatedEntities"
17847
+ }
17848
+ ],
17849
+ "doc": "The params required if the module is type HIERARCHY_VIEW\nTODO: add filters\nrelatedEntitiesFilter: optional Filter"
17850
+ }
17851
+ ],
17852
+ "name": "hierarchyViewParams",
17853
+ "default": null,
17854
+ "doc": "The params required if the module is type HIERARCHY_VIEW"
17795
17855
  }
17796
17856
  ],
17797
17857
  "doc": "The specific parameters stored for a module"
@@ -169,6 +169,12 @@
169
169
  "namespace": "com.linkedin.pegasus2avro.identity",
170
170
  "fields": [
171
171
  {
172
+ "Relationship": {
173
+ "entityTypes": [
174
+ "dataHubPageTemplate"
175
+ ],
176
+ "name": "HasPersonalPageTemplate"
177
+ },
172
178
  "java": {
173
179
  "class": "com.linkedin.pegasus2avro.common.urn.Urn"
174
180
  },
@@ -179,7 +185,10 @@
179
185
  "name": "pageTemplate",
180
186
  "default": null,
181
187
  "doc": "The page template that will be rendered in the UI by default for this user",
182
- "Urn": "Urn"
188
+ "Urn": "Urn",
189
+ "entityTypes": [
190
+ "dataHubPageTemplate"
191
+ ]
183
192
  },
184
193
  {
185
194
  "type": [
@@ -156,6 +156,39 @@
156
156
  "name": "assetCollectionParams",
157
157
  "default": null,
158
158
  "doc": "The params required if the module is type ASSET_COLLECTION"
159
+ },
160
+ {
161
+ "type": [
162
+ "null",
163
+ {
164
+ "type": "record",
165
+ "name": "HierarchyModuleParams",
166
+ "namespace": "com.linkedin.pegasus2avro.module",
167
+ "fields": [
168
+ {
169
+ "type": [
170
+ "null",
171
+ {
172
+ "type": "array",
173
+ "items": "string"
174
+ }
175
+ ],
176
+ "name": "assetUrns",
177
+ "default": null,
178
+ "Urn": "Urn",
179
+ "urn_is_array": true
180
+ },
181
+ {
182
+ "type": "boolean",
183
+ "name": "showRelatedEntities"
184
+ }
185
+ ],
186
+ "doc": "The params required if the module is type HIERARCHY_VIEW\nTODO: add filters\nrelatedEntitiesFilter: optional Filter"
187
+ }
188
+ ],
189
+ "name": "hierarchyViewParams",
190
+ "default": null,
191
+ "doc": "The params required if the module is type HIERARCHY_VIEW"
159
192
  }
160
193
  ],
161
194
  "doc": "The specific parameters stored for a module"
@@ -8218,6 +8218,24 @@
8218
8218
  "name": "version",
8219
8219
  "default": null,
8220
8220
  "doc": "Aspect version\n Initial implementation will use the aspect version's number, however stored as\n a string in the case where a different aspect versioning scheme is later adopted."
8221
+ },
8222
+ {
8223
+ "type": [
8224
+ "null",
8225
+ "com.linkedin.pegasus2avro.common.AuditStamp"
8226
+ ],
8227
+ "name": "aspectCreated",
8228
+ "default": null,
8229
+ "doc": "When the aspect was initially created and who created it, detected by version 0 -> 1 change"
8230
+ },
8231
+ {
8232
+ "type": [
8233
+ "null",
8234
+ "com.linkedin.pegasus2avro.common.AuditStamp"
8235
+ ],
8236
+ "name": "aspectModified",
8237
+ "default": null,
8238
+ "doc": "When the aspect was last modified and the actor that performed the modification"
8221
8239
  }
8222
8240
  ],
8223
8241
  "doc": "Metadata associated with each metadata change that is processed by the system"
@@ -267,6 +267,67 @@
267
267
  "name": "version",
268
268
  "default": null,
269
269
  "doc": "Aspect version\n Initial implementation will use the aspect version's number, however stored as\n a string in the case where a different aspect versioning scheme is later adopted."
270
+ },
271
+ {
272
+ "type": [
273
+ "null",
274
+ {
275
+ "type": "record",
276
+ "name": "AuditStamp",
277
+ "namespace": "com.linkedin.pegasus2avro.common",
278
+ "fields": [
279
+ {
280
+ "type": "long",
281
+ "name": "time",
282
+ "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
283
+ },
284
+ {
285
+ "java": {
286
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
287
+ },
288
+ "type": "string",
289
+ "name": "actor",
290
+ "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.",
291
+ "Urn": "Urn"
292
+ },
293
+ {
294
+ "java": {
295
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
296
+ },
297
+ "type": [
298
+ "null",
299
+ "string"
300
+ ],
301
+ "name": "impersonator",
302
+ "default": null,
303
+ "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.",
304
+ "Urn": "Urn"
305
+ },
306
+ {
307
+ "type": [
308
+ "null",
309
+ "string"
310
+ ],
311
+ "name": "message",
312
+ "default": null,
313
+ "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
314
+ }
315
+ ],
316
+ "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."
317
+ }
318
+ ],
319
+ "name": "aspectCreated",
320
+ "default": null,
321
+ "doc": "When the aspect was initially created and who created it, detected by version 0 -> 1 change"
322
+ },
323
+ {
324
+ "type": [
325
+ "null",
326
+ "com.linkedin.pegasus2avro.common.AuditStamp"
327
+ ],
328
+ "name": "aspectModified",
329
+ "default": null,
330
+ "doc": "When the aspect was last modified and the actor that performed the modification"
270
331
  }
271
332
  ],
272
333
  "doc": "Metadata associated with each metadata change that is processed by the system"
@@ -309,50 +370,7 @@
309
370
  {
310
371
  "type": [
311
372
  "null",
312
- {
313
- "type": "record",
314
- "name": "AuditStamp",
315
- "namespace": "com.linkedin.pegasus2avro.common",
316
- "fields": [
317
- {
318
- "type": "long",
319
- "name": "time",
320
- "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
321
- },
322
- {
323
- "java": {
324
- "class": "com.linkedin.pegasus2avro.common.urn.Urn"
325
- },
326
- "type": "string",
327
- "name": "actor",
328
- "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.",
329
- "Urn": "Urn"
330
- },
331
- {
332
- "java": {
333
- "class": "com.linkedin.pegasus2avro.common.urn.Urn"
334
- },
335
- "type": [
336
- "null",
337
- "string"
338
- ],
339
- "name": "impersonator",
340
- "default": null,
341
- "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.",
342
- "Urn": "Urn"
343
- },
344
- {
345
- "type": [
346
- "null",
347
- "string"
348
- ],
349
- "name": "message",
350
- "default": null,
351
- "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
352
- }
353
- ],
354
- "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."
355
- }
373
+ "com.linkedin.pegasus2avro.common.AuditStamp"
356
374
  ],
357
375
  "name": "created",
358
376
  "default": null,
@@ -267,6 +267,67 @@
267
267
  "name": "version",
268
268
  "default": null,
269
269
  "doc": "Aspect version\n Initial implementation will use the aspect version's number, however stored as\n a string in the case where a different aspect versioning scheme is later adopted."
270
+ },
271
+ {
272
+ "type": [
273
+ "null",
274
+ {
275
+ "type": "record",
276
+ "name": "AuditStamp",
277
+ "namespace": "com.linkedin.pegasus2avro.common",
278
+ "fields": [
279
+ {
280
+ "type": "long",
281
+ "name": "time",
282
+ "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
283
+ },
284
+ {
285
+ "java": {
286
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
287
+ },
288
+ "type": "string",
289
+ "name": "actor",
290
+ "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.",
291
+ "Urn": "Urn"
292
+ },
293
+ {
294
+ "java": {
295
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
296
+ },
297
+ "type": [
298
+ "null",
299
+ "string"
300
+ ],
301
+ "name": "impersonator",
302
+ "default": null,
303
+ "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.",
304
+ "Urn": "Urn"
305
+ },
306
+ {
307
+ "type": [
308
+ "null",
309
+ "string"
310
+ ],
311
+ "name": "message",
312
+ "default": null,
313
+ "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
314
+ }
315
+ ],
316
+ "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."
317
+ }
318
+ ],
319
+ "name": "aspectCreated",
320
+ "default": null,
321
+ "doc": "When the aspect was initially created and who created it, detected by version 0 -> 1 change"
322
+ },
323
+ {
324
+ "type": [
325
+ "null",
326
+ "com.linkedin.pegasus2avro.common.AuditStamp"
327
+ ],
328
+ "name": "aspectModified",
329
+ "default": null,
330
+ "doc": "When the aspect was last modified and the actor that performed the modification"
270
331
  }
271
332
  ],
272
333
  "doc": "Metadata associated with each metadata change that is processed by the system"
@@ -80,6 +80,67 @@
80
80
  "name": "version",
81
81
  "default": null,
82
82
  "doc": "Aspect version\n Initial implementation will use the aspect version's number, however stored as\n a string in the case where a different aspect versioning scheme is later adopted."
83
+ },
84
+ {
85
+ "type": [
86
+ "null",
87
+ {
88
+ "type": "record",
89
+ "name": "AuditStamp",
90
+ "namespace": "com.linkedin.pegasus2avro.common",
91
+ "fields": [
92
+ {
93
+ "type": "long",
94
+ "name": "time",
95
+ "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
96
+ },
97
+ {
98
+ "java": {
99
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
100
+ },
101
+ "type": "string",
102
+ "name": "actor",
103
+ "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.",
104
+ "Urn": "Urn"
105
+ },
106
+ {
107
+ "java": {
108
+ "class": "com.linkedin.pegasus2avro.common.urn.Urn"
109
+ },
110
+ "type": [
111
+ "null",
112
+ "string"
113
+ ],
114
+ "name": "impersonator",
115
+ "default": null,
116
+ "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.",
117
+ "Urn": "Urn"
118
+ },
119
+ {
120
+ "type": [
121
+ "null",
122
+ "string"
123
+ ],
124
+ "name": "message",
125
+ "default": null,
126
+ "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
127
+ }
128
+ ],
129
+ "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."
130
+ }
131
+ ],
132
+ "name": "aspectCreated",
133
+ "default": null,
134
+ "doc": "When the aspect was initially created and who created it, detected by version 0 -> 1 change"
135
+ },
136
+ {
137
+ "type": [
138
+ "null",
139
+ "com.linkedin.pegasus2avro.common.AuditStamp"
140
+ ],
141
+ "name": "aspectModified",
142
+ "default": null,
143
+ "doc": "When the aspect was last modified and the actor that performed the modification"
83
144
  }
84
145
  ],
85
146
  "doc": "Metadata associated with each metadata change that is processed by the system"
@@ -29,7 +29,7 @@ from datahub.ingestion.graph.filters import (
29
29
  _get_status_filter,
30
30
  )
31
31
  from datahub.metadata.schema_classes import EntityTypeName
32
- from datahub.metadata.urns import DataPlatformUrn, DomainUrn
32
+ from datahub.metadata.urns import ContainerUrn, DataPlatformUrn, DomainUrn
33
33
 
34
34
  _AndSearchFilterRule = TypedDict(
35
35
  "_AndSearchFilterRule", {"and": List[SearchFilterRule]}
@@ -81,7 +81,7 @@ class _EntityTypeFilter(_BaseFilter):
81
81
  ENTITY_TYPE_FIELD: ClassVar[str] = "_entityType"
82
82
 
83
83
  entity_type: List[str] = pydantic.Field(
84
- description="The entity type to filter on. Can be 'dataset', 'chart', 'dashboard', 'corpuser', etc.",
84
+ description="The entity type to filter on. Can be 'dataset', 'chart', 'dashboard', 'corpuser', 'dataProduct', etc.",
85
85
  )
86
86
 
87
87
  def _build_rule(self) -> SearchFilterRule:
@@ -174,6 +174,39 @@ class _DomainFilter(_BaseFilter):
174
174
  return [{"and": [self._build_rule()]}]
175
175
 
176
176
 
177
+ class _ContainerFilter(_BaseFilter):
178
+ container: List[str]
179
+ direct_descendants_only: bool = pydantic.Field(
180
+ default=False,
181
+ description="If true, only entities that are direct descendants of the container will be returned.",
182
+ )
183
+
184
+ @pydantic.validator("container", each_item=True)
185
+ def validate_container(cls, v: str) -> str:
186
+ return str(ContainerUrn.from_string(v))
187
+
188
+ @classmethod
189
+ def _field_discriminator(cls) -> str:
190
+ return "container"
191
+
192
+ def _build_rule(self) -> SearchFilterRule:
193
+ if self.direct_descendants_only:
194
+ return SearchFilterRule(
195
+ field="container",
196
+ condition="EQUAL",
197
+ values=self.container,
198
+ )
199
+ else:
200
+ return SearchFilterRule(
201
+ field="browsePathV2",
202
+ condition="CONTAIN",
203
+ values=self.container,
204
+ )
205
+
206
+ def compile(self) -> _OrFilters:
207
+ return [{"and": [self._build_rule()]}]
208
+
209
+
177
210
  class _EnvFilter(_BaseFilter):
178
211
  # Note that not all entity types have an env (e.g. dashboards / charts).
179
212
  # If the env filter is specified, these will be excluded.
@@ -342,6 +375,8 @@ def _filter_discriminator(v: Any) -> Optional[str]:
342
375
  keys = list(v.keys())
343
376
  if len(keys) == 1:
344
377
  return keys[0]
378
+ elif set(keys).issuperset({"container"}):
379
+ return _ContainerFilter._field_discriminator()
345
380
  elif set(keys).issuperset({"field", "condition"}):
346
381
  return _CustomCondition._field_discriminator()
347
382
 
@@ -360,6 +395,7 @@ if TYPE_CHECKING or not PYDANTIC_SUPPORTS_CALLABLE_DISCRIMINATOR:
360
395
  _StatusFilter,
361
396
  _PlatformFilter,
362
397
  _DomainFilter,
398
+ _ContainerFilter,
363
399
  _EnvFilter,
364
400
  _CustomCondition,
365
401
  ]
@@ -385,6 +421,7 @@ else:
385
421
  Annotated[_StatusFilter, Tag(_StatusFilter._field_discriminator())],
386
422
  Annotated[_PlatformFilter, Tag(_PlatformFilter._field_discriminator())],
387
423
  Annotated[_DomainFilter, Tag(_DomainFilter._field_discriminator())],
424
+ Annotated[_ContainerFilter, Tag(_ContainerFilter._field_discriminator())],
388
425
  Annotated[_EnvFilter, Tag(_EnvFilter._field_discriminator())],
389
426
  Annotated[_CustomCondition, Tag(_CustomCondition._field_discriminator())],
390
427
  ],
@@ -468,6 +505,18 @@ class FilterDsl:
468
505
  def domain(domain: Union[str, Sequence[str]], /) -> _DomainFilter:
469
506
  return _DomainFilter(domain=[domain] if isinstance(domain, str) else domain)
470
507
 
508
+ @staticmethod
509
+ def container(
510
+ container: Union[str, Sequence[str]],
511
+ /,
512
+ *,
513
+ direct_descendants_only: bool = False,
514
+ ) -> _ContainerFilter:
515
+ return _ContainerFilter(
516
+ container=[container] if isinstance(container, str) else container,
517
+ direct_descendants_only=direct_descendants_only,
518
+ )
519
+
471
520
  @staticmethod
472
521
  def env(env: Union[str, Sequence[str]], /) -> _EnvFilter:
473
522
  return _EnvFilter(env=[env] if isinstance(env, str) else env)
@@ -190,6 +190,7 @@ class QueryMetadata:
190
190
  source=models.QuerySourceClass.SYSTEM,
191
191
  created=self.make_created_audit_stamp(),
192
192
  lastModified=self.make_last_modified_audit_stamp(),
193
+ origin=self.origin.urn() if self.origin else None,
193
194
  )
194
195
 
195
196
 
@@ -352,9 +352,11 @@ def _maybe_print_upgrade_message(
352
352
  if version_stats.client.latest
353
353
  else None
354
354
  )
355
- client_server_compat = is_client_server_compatible(
356
- version_stats.client.current, version_stats.server.current
357
- )
355
+ client_server_compat = 0
356
+ if version_stats.server.current_server_type != "cloud":
357
+ client_server_compat = is_client_server_compatible(
358
+ version_stats.client.current, version_stats.server.current
359
+ )
358
360
 
359
361
  if latest_release_date and current_release_date:
360
362
  assert version_stats.client.latest