acryl-datahub 0.15.0rc19__py3-none-any.whl → 0.15.0rc21__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.0rc19.dist-info → acryl_datahub-0.15.0rc21.dist-info}/METADATA +2334 -2334
- {acryl_datahub-0.15.0rc19.dist-info → acryl_datahub-0.15.0rc21.dist-info}/RECORD +20 -20
- datahub/__init__.py +1 -1
- datahub/api/entities/structuredproperties/structuredproperties.py +56 -68
- datahub/emitter/rest_emitter.py +17 -4
- datahub/ingestion/sink/datahub_rest.py +12 -1
- datahub/ingestion/source/dremio/dremio_api.py +193 -86
- datahub/ingestion/source/dremio/dremio_datahub_source_mapping.py +2 -0
- datahub/ingestion/source/dremio/dremio_reporting.py +15 -0
- datahub/ingestion/source/kafka/kafka_connect.py +81 -51
- datahub/ingestion/source/snowflake/snowflake_lineage_v2.py +2 -1
- datahub/ingestion/source/snowflake/snowflake_query.py +13 -0
- datahub/ingestion/source/snowflake/snowflake_schema.py +16 -0
- datahub/ingestion/source/snowflake/snowflake_schema_gen.py +23 -0
- datahub/metadata/_schema_classes.py +400 -400
- datahub/metadata/_urns/urn_defs.py +1355 -1355
- datahub/metadata/schema.avsc +17221 -17574
- {acryl_datahub-0.15.0rc19.dist-info → acryl_datahub-0.15.0rc21.dist-info}/WHEEL +0 -0
- {acryl_datahub-0.15.0rc19.dist-info → acryl_datahub-0.15.0rc21.dist-info}/entry_points.txt +0 -0
- {acryl_datahub-0.15.0rc19.dist-info → acryl_datahub-0.15.0rc21.dist-info}/top_level.txt +0 -0
|
@@ -266,6 +266,22 @@ class SnowflakeDataDictionary(SupportsAsObj):
|
|
|
266
266
|
snowflake_schemas.append(snowflake_schema)
|
|
267
267
|
return snowflake_schemas
|
|
268
268
|
|
|
269
|
+
@serialized_lru_cache(maxsize=1)
|
|
270
|
+
def get_secure_view_definitions(self) -> Dict[str, Dict[str, Dict[str, str]]]:
|
|
271
|
+
secure_view_definitions: Dict[str, Dict[str, Dict[str, str]]] = defaultdict(
|
|
272
|
+
lambda: defaultdict(lambda: defaultdict())
|
|
273
|
+
)
|
|
274
|
+
cur = self.connection.query(SnowflakeQuery.get_secure_view_definitions())
|
|
275
|
+
for view in cur:
|
|
276
|
+
db_name = view["TABLE_CATALOG"]
|
|
277
|
+
schema_name = view["TABLE_SCHEMA"]
|
|
278
|
+
view_name = view["TABLE_NAME"]
|
|
279
|
+
secure_view_definitions[db_name][schema_name][view_name] = view[
|
|
280
|
+
"VIEW_DEFINITION"
|
|
281
|
+
]
|
|
282
|
+
|
|
283
|
+
return secure_view_definitions
|
|
284
|
+
|
|
269
285
|
@serialized_lru_cache(maxsize=1)
|
|
270
286
|
def get_tables_for_database(
|
|
271
287
|
self, db_name: str
|
|
@@ -424,6 +424,10 @@ class SnowflakeSchemaGenerator(SnowflakeStructuredReportMixin):
|
|
|
424
424
|
view_identifier = self.identifiers.get_dataset_identifier(
|
|
425
425
|
view.name, schema_name, db_name
|
|
426
426
|
)
|
|
427
|
+
if view.is_secure and not view.view_definition:
|
|
428
|
+
view.view_definition = self.fetch_secure_view_definition(
|
|
429
|
+
view.name, schema_name, db_name
|
|
430
|
+
)
|
|
427
431
|
if view.view_definition:
|
|
428
432
|
self.aggregator.add_view_definition(
|
|
429
433
|
view_urn=self.identifiers.gen_dataset_urn(view_identifier),
|
|
@@ -449,6 +453,25 @@ class SnowflakeSchemaGenerator(SnowflakeStructuredReportMixin):
|
|
|
449
453
|
context=f"{db_name}.{schema_name}",
|
|
450
454
|
)
|
|
451
455
|
|
|
456
|
+
def fetch_secure_view_definition(
|
|
457
|
+
self, table_name: str, schema_name: str, db_name: str
|
|
458
|
+
) -> Optional[str]:
|
|
459
|
+
try:
|
|
460
|
+
view_definitions = self.data_dictionary.get_secure_view_definitions()
|
|
461
|
+
return view_definitions[db_name][schema_name][table_name]
|
|
462
|
+
except Exception as e:
|
|
463
|
+
if isinstance(e, SnowflakePermissionError):
|
|
464
|
+
error_msg = (
|
|
465
|
+
"Failed to get secure views definitions. Please check permissions."
|
|
466
|
+
)
|
|
467
|
+
else:
|
|
468
|
+
error_msg = "Failed to get secure views definitions"
|
|
469
|
+
self.structured_reporter.warning(
|
|
470
|
+
error_msg,
|
|
471
|
+
exc=e,
|
|
472
|
+
)
|
|
473
|
+
return None
|
|
474
|
+
|
|
452
475
|
def fetch_views_for_schema(
|
|
453
476
|
self, snowflake_schema: SnowflakeSchema, db_name: str, schema_name: str
|
|
454
477
|
) -> List[SnowflakeView]:
|