acryl-datahub 1.2.0.3rc1__py3-none-any.whl → 1.2.0.4rc1__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 (38) hide show
  1. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/METADATA +2535 -2535
  2. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/RECORD +38 -38
  3. datahub/_version.py +1 -1
  4. datahub/api/entities/external/external_tag.py +6 -4
  5. datahub/api/entities/external/lake_formation_external_entites.py +50 -49
  6. datahub/api/entities/external/restricted_text.py +107 -182
  7. datahub/api/entities/external/unity_catalog_external_entites.py +51 -52
  8. datahub/emitter/rest_emitter.py +18 -5
  9. datahub/ingestion/api/source.py +81 -7
  10. datahub/ingestion/autogenerated/capability_summary.json +47 -19
  11. datahub/ingestion/graph/client.py +19 -3
  12. datahub/ingestion/sink/datahub_rest.py +2 -0
  13. datahub/ingestion/source/abs/source.py +9 -0
  14. datahub/ingestion/source/aws/glue.py +18 -2
  15. datahub/ingestion/source/aws/tag_entities.py +2 -2
  16. datahub/ingestion/source/datahub/datahub_source.py +8 -1
  17. datahub/ingestion/source/dbt/dbt_common.py +10 -0
  18. datahub/ingestion/source/delta_lake/source.py +8 -1
  19. datahub/ingestion/source/dremio/dremio_source.py +19 -2
  20. datahub/ingestion/source/fivetran/fivetran.py +9 -3
  21. datahub/ingestion/source/ge_data_profiler.py +8 -0
  22. datahub/ingestion/source/hex/query_fetcher.py +1 -1
  23. datahub/ingestion/source/looker/looker_liquid_tag.py +56 -5
  24. datahub/ingestion/source/mock_data/datahub_mock_data.py +26 -10
  25. datahub/ingestion/source/powerbi/powerbi.py +4 -1
  26. datahub/ingestion/source/redshift/redshift.py +1 -0
  27. datahub/ingestion/source/salesforce.py +8 -0
  28. datahub/ingestion/source/sql/athena_properties_extractor.py +2 -2
  29. datahub/ingestion/source/sql/hive_metastore.py +8 -0
  30. datahub/ingestion/source/sql/teradata.py +8 -1
  31. datahub/ingestion/source/sql/trino.py +9 -0
  32. datahub/ingestion/source/unity/tag_entities.py +3 -3
  33. datahub/sdk/entity_client.py +22 -7
  34. datahub/utilities/mapping.py +29 -2
  35. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/WHEEL +0 -0
  36. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/entry_points.txt +0 -0
  37. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/licenses/LICENSE +0 -0
  38. {acryl_datahub-1.2.0.3rc1.dist-info → acryl_datahub-1.2.0.4rc1.dist-info}/top_level.txt +0 -0
@@ -81,11 +81,24 @@ class StructuredLogLevel(Enum):
81
81
  ERROR = logging.ERROR
82
82
 
83
83
 
84
+ class StructuredLogCategory(Enum):
85
+ """
86
+ This is used to categorise the errors mainly based on the biggest impact area
87
+ This is to be used to help in self-serve understand the impact of any log entry
88
+ More enums to be added as logs are updated to be self-serve
89
+ """
90
+
91
+ LINEAGE = "LINEAGE"
92
+ USAGE = "USAGE"
93
+ PROFILING = "PROFILING"
94
+
95
+
84
96
  @dataclass
85
97
  class StructuredLogEntry(Report):
86
98
  title: Optional[str]
87
99
  message: str
88
100
  context: LossyList[str]
101
+ log_category: Optional[StructuredLogCategory] = None
89
102
 
90
103
 
91
104
  @dataclass
@@ -108,9 +121,10 @@ class StructuredLogs(Report):
108
121
  exc: Optional[BaseException] = None,
109
122
  log: bool = False,
110
123
  stacklevel: int = 1,
124
+ log_category: Optional[StructuredLogCategory] = None,
111
125
  ) -> None:
112
126
  """
113
- Report a user-facing warning for the ingestion run.
127
+ Report a user-facing log for the ingestion run.
114
128
 
115
129
  Args:
116
130
  level: The level of the log entry.
@@ -118,6 +132,9 @@ class StructuredLogs(Report):
118
132
  title: The category / heading to present on for this message in the UI.
119
133
  context: Additional context (e.g. where, how) for the log entry.
120
134
  exc: The exception associated with the event. We'll show the stack trace when in debug mode.
135
+ log_category: The type of the log entry. This is used to categorise the log entry.
136
+ log: Whether to log the entry to the console.
137
+ stacklevel: The stack level to use for the log entry.
121
138
  """
122
139
 
123
140
  # One for this method, and one for the containing report_* call.
@@ -160,6 +177,7 @@ class StructuredLogs(Report):
160
177
  title=title,
161
178
  message=message,
162
179
  context=context_list,
180
+ log_category=log_category,
163
181
  )
164
182
  else:
165
183
  if context is not None:
@@ -219,9 +237,19 @@ class SourceReport(ExamplesReport):
219
237
  context: Optional[str] = None,
220
238
  title: Optional[LiteralString] = None,
221
239
  exc: Optional[BaseException] = None,
240
+ log_category: Optional[StructuredLogCategory] = None,
222
241
  ) -> None:
242
+ """
243
+ See docs of StructuredLogs.report_log for details of args
244
+ """
223
245
  self._structured_logs.report_log(
224
- StructuredLogLevel.WARN, message, title, context, exc, log=False
246
+ StructuredLogLevel.WARN,
247
+ message,
248
+ title,
249
+ context,
250
+ exc,
251
+ log=False,
252
+ log_category=log_category,
225
253
  )
226
254
 
227
255
  def warning(
@@ -231,9 +259,19 @@ class SourceReport(ExamplesReport):
231
259
  title: Optional[LiteralString] = None,
232
260
  exc: Optional[BaseException] = None,
233
261
  log: bool = True,
262
+ log_category: Optional[StructuredLogCategory] = None,
234
263
  ) -> None:
264
+ """
265
+ See docs of StructuredLogs.report_log for details of args
266
+ """
235
267
  self._structured_logs.report_log(
236
- StructuredLogLevel.WARN, message, title, context, exc, log=log
268
+ StructuredLogLevel.WARN,
269
+ message,
270
+ title,
271
+ context,
272
+ exc,
273
+ log=log,
274
+ log_category=log_category,
237
275
  )
238
276
 
239
277
  def report_failure(
@@ -243,9 +281,19 @@ class SourceReport(ExamplesReport):
243
281
  title: Optional[LiteralString] = None,
244
282
  exc: Optional[BaseException] = None,
245
283
  log: bool = True,
284
+ log_category: Optional[StructuredLogCategory] = None,
246
285
  ) -> None:
286
+ """
287
+ See docs of StructuredLogs.report_log for details of args
288
+ """
247
289
  self._structured_logs.report_log(
248
- StructuredLogLevel.ERROR, message, title, context, exc, log=log
290
+ StructuredLogLevel.ERROR,
291
+ message,
292
+ title,
293
+ context,
294
+ exc,
295
+ log=log,
296
+ log_category=log_category,
249
297
  )
250
298
 
251
299
  def failure(
@@ -255,9 +303,19 @@ class SourceReport(ExamplesReport):
255
303
  title: Optional[LiteralString] = None,
256
304
  exc: Optional[BaseException] = None,
257
305
  log: bool = True,
306
+ log_category: Optional[StructuredLogCategory] = None,
258
307
  ) -> None:
308
+ """
309
+ See docs of StructuredLogs.report_log for details of args
310
+ """
259
311
  self._structured_logs.report_log(
260
- StructuredLogLevel.ERROR, message, title, context, exc, log=log
312
+ StructuredLogLevel.ERROR,
313
+ message,
314
+ title,
315
+ context,
316
+ exc,
317
+ log=log,
318
+ log_category=log_category,
261
319
  )
262
320
 
263
321
  def info(
@@ -267,9 +325,19 @@ class SourceReport(ExamplesReport):
267
325
  title: Optional[LiteralString] = None,
268
326
  exc: Optional[BaseException] = None,
269
327
  log: bool = True,
328
+ log_category: Optional[StructuredLogCategory] = None,
270
329
  ) -> None:
330
+ """
331
+ See docs of StructuredLogs.report_log for details of args
332
+ """
271
333
  self._structured_logs.report_log(
272
- StructuredLogLevel.INFO, message, title, context, exc, log=log
334
+ StructuredLogLevel.INFO,
335
+ message,
336
+ title,
337
+ context,
338
+ exc,
339
+ log=log,
340
+ log_category=log_category,
273
341
  )
274
342
 
275
343
  @contextlib.contextmanager
@@ -279,6 +347,7 @@ class SourceReport(ExamplesReport):
279
347
  title: Optional[LiteralString] = None,
280
348
  context: Optional[str] = None,
281
349
  level: StructuredLogLevel = StructuredLogLevel.ERROR,
350
+ log_category: Optional[StructuredLogCategory] = None,
282
351
  ) -> Iterator[None]:
283
352
  # Convenience method that helps avoid boilerplate try/except blocks.
284
353
  # TODO: I'm not super happy with the naming here - it's not obvious that this
@@ -287,7 +356,12 @@ class SourceReport(ExamplesReport):
287
356
  yield
288
357
  except Exception as exc:
289
358
  self._structured_logs.report_log(
290
- level, message=message, title=title, context=context, exc=exc
359
+ level,
360
+ message=message,
361
+ title=title,
362
+ context=context,
363
+ exc=exc,
364
+ log_category=log_category,
291
365
  )
292
366
 
293
367
  def __post_init__(self) -> None:
@@ -1,9 +1,18 @@
1
1
  {
2
- "generated_at": "2025-07-24T13:24:05.751563+00:00",
2
+ "generated_at": "2025-07-31T12:54:30.557618+00:00",
3
3
  "generated_by": "metadata-ingestion/scripts/capability_summary.py",
4
4
  "plugin_details": {
5
5
  "abs": {
6
6
  "capabilities": [
7
+ {
8
+ "capability": "CONTAINERS",
9
+ "description": "Extract ABS containers and folders",
10
+ "subtype_modifier": [
11
+ "Folder",
12
+ "ABS container"
13
+ ],
14
+ "supported": true
15
+ },
7
16
  {
8
17
  "capability": "DATA_PROFILING",
9
18
  "description": "Optionally enabled via configuration",
@@ -468,7 +477,9 @@
468
477
  {
469
478
  "capability": "CONTAINERS",
470
479
  "description": "Enabled by default",
471
- "subtype_modifier": null,
480
+ "subtype_modifier": [
481
+ "Database"
482
+ ],
472
483
  "supported": true
473
484
  },
474
485
  {
@@ -531,13 +542,6 @@
531
542
  "platform_name": "File Based Lineage",
532
543
  "support_status": "CERTIFIED"
533
544
  },
534
- "datahub-mock-data": {
535
- "capabilities": [],
536
- "classname": "datahub.ingestion.source.mock_data.datahub_mock_data.DataHubMockDataSource",
537
- "platform_id": "datahubmockdata",
538
- "platform_name": "DataHubMockData",
539
- "support_status": "TESTING"
540
- },
541
545
  "dbt": {
542
546
  "capabilities": [
543
547
  {
@@ -607,7 +611,9 @@
607
611
  {
608
612
  "capability": "CONTAINERS",
609
613
  "description": "Enabled by default",
610
- "subtype_modifier": null,
614
+ "subtype_modifier": [
615
+ "Folder"
616
+ ],
611
617
  "supported": true
612
618
  },
613
619
  {
@@ -643,6 +649,14 @@
643
649
  "subtype_modifier": null,
644
650
  "supported": true
645
651
  },
652
+ {
653
+ "capability": "LINEAGE_FINE",
654
+ "description": "Extract column-level lineage",
655
+ "subtype_modifier": [
656
+ "Table"
657
+ ],
658
+ "supported": true
659
+ },
646
660
  {
647
661
  "capability": "DATA_PROFILING",
648
662
  "description": "Optionally enabled via configuration",
@@ -688,7 +702,9 @@
688
702
  {
689
703
  "capability": "LINEAGE_COARSE",
690
704
  "description": "Enabled by default",
691
- "subtype_modifier": null,
705
+ "subtype_modifier": [
706
+ "Table"
707
+ ],
692
708
  "supported": true
693
709
  }
694
710
  ],
@@ -1229,8 +1245,7 @@
1229
1245
  "capability": "CONTAINERS",
1230
1246
  "description": "Enabled by default",
1231
1247
  "subtype_modifier": [
1232
- "Database",
1233
- "Schema"
1248
+ "Catalog"
1234
1249
  ],
1235
1250
  "supported": true
1236
1251
  },
@@ -2387,8 +2402,9 @@
2387
2402
  },
2388
2403
  {
2389
2404
  "capability": "LINEAGE_COARSE",
2390
- "description": "Enabled by default to get lineage for views via `include_view_lineage`",
2405
+ "description": "Extract table-level lineage",
2391
2406
  "subtype_modifier": [
2407
+ "Table",
2392
2408
  "View"
2393
2409
  ],
2394
2410
  "supported": true
@@ -2411,8 +2427,7 @@
2411
2427
  "capability": "CONTAINERS",
2412
2428
  "description": "Enabled by default",
2413
2429
  "subtype_modifier": [
2414
- "Database",
2415
- "Schema"
2430
+ "Catalog"
2416
2431
  ],
2417
2432
  "supported": true
2418
2433
  },
@@ -2598,7 +2613,8 @@
2598
2613
  "capability": "CONTAINERS",
2599
2614
  "description": "Enabled by default",
2600
2615
  "subtype_modifier": [
2601
- "Database"
2616
+ "Database",
2617
+ "Schema"
2602
2618
  ],
2603
2619
  "supported": true
2604
2620
  },
@@ -2812,6 +2828,15 @@
2812
2828
  "description": "Enabled by default",
2813
2829
  "subtype_modifier": null,
2814
2830
  "supported": true
2831
+ },
2832
+ {
2833
+ "capability": "LINEAGE_COARSE",
2834
+ "description": "Extract table-level lineage for Salesforce objects",
2835
+ "subtype_modifier": [
2836
+ "Custom Object",
2837
+ "Object"
2838
+ ],
2839
+ "supported": true
2815
2840
  }
2816
2841
  ],
2817
2842
  "classname": "datahub.ingestion.source.salesforce.SalesforceSource",
@@ -3207,7 +3232,9 @@
3207
3232
  {
3208
3233
  "capability": "CONTAINERS",
3209
3234
  "description": "Enabled by default",
3210
- "subtype_modifier": null,
3235
+ "subtype_modifier": [
3236
+ "Database"
3237
+ ],
3211
3238
  "supported": true
3212
3239
  },
3213
3240
  {
@@ -3339,8 +3366,9 @@
3339
3366
  },
3340
3367
  {
3341
3368
  "capability": "LINEAGE_COARSE",
3342
- "description": "Enabled by default to get lineage for views via `include_view_lineage`",
3369
+ "description": "Extract table-level lineage",
3343
3370
  "subtype_modifier": [
3371
+ "Table",
3344
3372
  "View"
3345
3373
  ],
3346
3374
  "supported": true
@@ -76,7 +76,15 @@ from datahub.metadata.schema_classes import (
76
76
  SystemMetadataClass,
77
77
  TelemetryClientIdClass,
78
78
  )
79
- from datahub.metadata.urns import CorpUserUrn, Urn
79
+ from datahub.metadata.urns import (
80
+ CorpUserUrn,
81
+ MlFeatureTableUrn,
82
+ MlFeatureUrn,
83
+ MlModelGroupUrn,
84
+ MlModelUrn,
85
+ MlPrimaryKeyUrn,
86
+ Urn,
87
+ )
80
88
  from datahub.telemetry.telemetry import telemetry_instance
81
89
  from datahub.utilities.perf_timer import PerfTimer
82
90
  from datahub.utilities.str_enum import StrEnum
@@ -118,8 +126,16 @@ def entity_type_to_graphql(entity_type: str) -> str:
118
126
  """Convert the entity types into GraphQL "EntityType" enum values."""
119
127
 
120
128
  # Hard-coded special cases.
121
- if entity_type == CorpUserUrn.ENTITY_TYPE:
122
- return "CORP_USER"
129
+ special_cases = {
130
+ CorpUserUrn.ENTITY_TYPE: "CORP_USER",
131
+ MlModelUrn.ENTITY_TYPE: "MLMODEL",
132
+ MlModelGroupUrn.ENTITY_TYPE: "MLMODEL_GROUP",
133
+ MlFeatureTableUrn.ENTITY_TYPE: "MLFEATURE_TABLE",
134
+ MlFeatureUrn.ENTITY_TYPE: "MLFEATURE",
135
+ MlPrimaryKeyUrn.ENTITY_TYPE: "MLPRIMARY_KEY",
136
+ }
137
+ if entity_type in special_cases:
138
+ return special_cases[entity_type]
123
139
 
124
140
  # Convert camelCase to UPPER_UNDERSCORE.
125
141
  entity_type = (
@@ -92,6 +92,7 @@ class DatahubRestSinkConfig(DatahubClientConfig):
92
92
  @dataclasses.dataclass
93
93
  class DataHubRestSinkReport(SinkReport):
94
94
  mode: Optional[RestSinkMode] = None
95
+ endpoint: Optional[RestSinkEndpoint] = None
95
96
  max_threads: Optional[int] = None
96
97
  gms_version: Optional[str] = None
97
98
  pending_requests: int = 0
@@ -142,6 +143,7 @@ class DatahubRestSink(Sink[DatahubRestSinkConfig, DataHubRestSinkReport]):
142
143
 
143
144
  self.report.gms_version = gms_config.service_version
144
145
  self.report.mode = self.config.mode
146
+ self.report.endpoint = self.config.endpoint
145
147
  self.report.max_threads = self.config.max_threads
146
148
  logger.debug("Setting env variables to override config")
147
149
  logger.debug("Setting gms config")
@@ -44,6 +44,7 @@ from datahub.ingestion.source.azure.abs_utils import (
44
44
  get_key_prefix,
45
45
  strip_abs_prefix,
46
46
  )
47
+ from datahub.ingestion.source.common.subtypes import SourceCapabilityModifier
47
48
  from datahub.ingestion.source.data_lake_common.data_lake_utils import (
48
49
  ContainerWUCreator,
49
50
  add_partition_columns_to_schema,
@@ -128,6 +129,14 @@ class TableData:
128
129
  @support_status(SupportStatus.INCUBATING)
129
130
  @capability(SourceCapability.DATA_PROFILING, "Optionally enabled via configuration")
130
131
  @capability(SourceCapability.TAGS, "Can extract ABS object/container tags if enabled")
132
+ @capability(
133
+ SourceCapability.CONTAINERS,
134
+ "Extract ABS containers and folders",
135
+ subtype_modifier=[
136
+ SourceCapabilityModifier.FOLDER,
137
+ SourceCapabilityModifier.ABS_CONTAINER,
138
+ ],
139
+ )
131
140
  class ABSSource(StatefulIngestionSourceBase):
132
141
  source_config: DataLakeSourceConfig
133
142
  report: DataLakeSourceReport
@@ -395,7 +395,7 @@ class GlueSource(StatefulIngestionSourceBase):
395
395
  t = LakeFormationTag(
396
396
  key=tag_key,
397
397
  value=tag_value,
398
- catalog_id=catalog_id,
398
+ catalog=catalog_id,
399
399
  )
400
400
  tags.append(t)
401
401
  return tags
@@ -438,7 +438,7 @@ class GlueSource(StatefulIngestionSourceBase):
438
438
  t = LakeFormationTag(
439
439
  key=tag_key,
440
440
  value=tag_value,
441
- catalog_id=catalog_id,
441
+ catalog=catalog_id,
442
442
  )
443
443
  tags.append(t)
444
444
  return tags
@@ -522,6 +522,14 @@ class GlueSource(StatefulIngestionSourceBase):
522
522
  bucket = url.netloc
523
523
  key = url.path[1:]
524
524
 
525
+ # validate that we have a non-empty key
526
+ if not key:
527
+ self.report.num_job_script_location_invalid += 1
528
+ logger.warning(
529
+ f"Error parsing DAG for Glue job. The script {script_path} is not a valid S3 path for flow urn: {flow_urn}."
530
+ )
531
+ return None
532
+
525
533
  # download the script contents
526
534
  # see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.get_object
527
535
  try:
@@ -533,6 +541,14 @@ class GlueSource(StatefulIngestionSourceBase):
533
541
  )
534
542
  self.report.num_job_script_failed_download += 1
535
543
  return None
544
+ except botocore.exceptions.ParamValidationError as e:
545
+ self.report_warning(
546
+ flow_urn,
547
+ f"Invalid S3 path for Glue job script {script_path}: {e}",
548
+ )
549
+ self.report.num_job_script_location_invalid += 1
550
+ return None
551
+
536
552
  script = obj["Body"].read().decode("utf-8")
537
553
 
538
554
  try:
@@ -88,8 +88,8 @@ class LakeFormationTagPlatformResourceId(BaseModel, ExternalEntityId):
88
88
  return existing_platform_resource
89
89
 
90
90
  return LakeFormationTagPlatformResourceId(
91
- tag_key=tag.key,
92
- tag_value=tag.value if tag.value is not None else None,
91
+ tag_key=str(tag.key),
92
+ tag_value=str(tag.value) if tag.value is not None else None,
93
93
  platform_instance=platform_instance,
94
94
  exists_in_lake_formation=exists_in_lake_formation,
95
95
  catalog=catalog,
@@ -19,6 +19,7 @@ from datahub.ingestion.api.source_helpers import (
19
19
  auto_workunit_reporter,
20
20
  )
21
21
  from datahub.ingestion.api.workunit import MetadataWorkUnit
22
+ from datahub.ingestion.source.common.subtypes import SourceCapabilityModifier
22
23
  from datahub.ingestion.source.datahub.config import DataHubSourceConfig
23
24
  from datahub.ingestion.source.datahub.datahub_api_reader import DataHubApiReader
24
25
  from datahub.ingestion.source.datahub.datahub_database_reader import (
@@ -39,7 +40,13 @@ logger = logging.getLogger(__name__)
39
40
  @platform_name("DataHub")
40
41
  @config_class(DataHubSourceConfig)
41
42
  @support_status(SupportStatus.TESTING)
42
- @capability(SourceCapability.CONTAINERS, "Enabled by default")
43
+ @capability(
44
+ SourceCapability.CONTAINERS,
45
+ "Enabled by default",
46
+ subtype_modifier=[
47
+ SourceCapabilityModifier.DATABASE,
48
+ ],
49
+ )
43
50
  class DataHubSource(StatefulIngestionSourceBase):
44
51
  platform: str = "datahub"
45
52
 
@@ -120,6 +120,7 @@ logger = logging.getLogger(__name__)
120
120
  DBT_PLATFORM = "dbt"
121
121
 
122
122
  _DEFAULT_ACTOR = mce_builder.make_user_urn("unknown")
123
+ _DBT_MAX_COMPILED_CODE_LENGTH = 1 * 1024 * 1024 # 1MB
123
124
 
124
125
 
125
126
  @dataclass
@@ -1684,6 +1685,12 @@ class DBTSourceBase(StatefulIngestionSourceBase):
1684
1685
  def get_external_url(self, node: DBTNode) -> Optional[str]:
1685
1686
  pass
1686
1687
 
1688
+ @staticmethod
1689
+ def _truncate_code(code: str, max_length: int) -> str:
1690
+ if len(code) > max_length:
1691
+ return code[:max_length] + "..."
1692
+ return code
1693
+
1687
1694
  def _create_view_properties_aspect(
1688
1695
  self, node: DBTNode
1689
1696
  ) -> Optional[ViewPropertiesClass]:
@@ -1695,6 +1702,9 @@ class DBTSourceBase(StatefulIngestionSourceBase):
1695
1702
  compiled_code = try_format_query(
1696
1703
  node.compiled_code, platform=self.config.target_platform
1697
1704
  )
1705
+ compiled_code = self._truncate_code(
1706
+ compiled_code, _DBT_MAX_COMPILED_CODE_LENGTH
1707
+ )
1698
1708
 
1699
1709
  materialized = node.materialization in {"table", "incremental", "snapshot"}
1700
1710
  view_properties = ViewPropertiesClass(
@@ -29,6 +29,7 @@ from datahub.ingestion.source.aws.s3_util import (
29
29
  get_key_prefix,
30
30
  strip_s3_prefix,
31
31
  )
32
+ from datahub.ingestion.source.common.subtypes import SourceCapabilityModifier
32
33
  from datahub.ingestion.source.data_lake_common.data_lake_utils import ContainerWUCreator
33
34
  from datahub.ingestion.source.delta_lake.config import DeltaLakeSourceConfig
34
35
  from datahub.ingestion.source.delta_lake.delta_lake_utils import (
@@ -85,7 +86,13 @@ OPERATION_STATEMENT_TYPES = {
85
86
  @config_class(DeltaLakeSourceConfig)
86
87
  @support_status(SupportStatus.INCUBATING)
87
88
  @capability(SourceCapability.TAGS, "Can extract S3 object/bucket tags if enabled")
88
- @capability(SourceCapability.CONTAINERS, "Enabled by default")
89
+ @capability(
90
+ SourceCapability.CONTAINERS,
91
+ "Enabled by default",
92
+ subtype_modifier=[
93
+ SourceCapabilityModifier.FOLDER,
94
+ ],
95
+ )
89
96
  class DeltaLakeSource(StatefulIngestionSourceBase):
90
97
  """
91
98
  This plugin extracts:
@@ -22,6 +22,7 @@ from datahub.ingestion.api.source import (
22
22
  SourceReport,
23
23
  )
24
24
  from datahub.ingestion.api.workunit import MetadataWorkUnit
25
+ from datahub.ingestion.source.common.subtypes import SourceCapabilityModifier
25
26
  from datahub.ingestion.source.dremio.dremio_api import (
26
27
  DremioAPIOperations,
27
28
  DremioEdition,
@@ -86,11 +87,27 @@ class DremioSourceMapEntry:
86
87
  @platform_name("Dremio")
87
88
  @config_class(DremioSourceConfig)
88
89
  @support_status(SupportStatus.CERTIFIED)
89
- @capability(SourceCapability.CONTAINERS, "Enabled by default")
90
+ @capability(
91
+ SourceCapability.CONTAINERS,
92
+ "Enabled by default",
93
+ )
90
94
  @capability(SourceCapability.DATA_PROFILING, "Optionally enabled via configuration")
91
95
  @capability(SourceCapability.DESCRIPTIONS, "Enabled by default")
92
96
  @capability(SourceCapability.DOMAINS, "Supported via the `domain` config field")
93
- @capability(SourceCapability.LINEAGE_COARSE, "Enabled by default")
97
+ @capability(
98
+ SourceCapability.LINEAGE_COARSE,
99
+ "Enabled by default",
100
+ subtype_modifier=[
101
+ SourceCapabilityModifier.TABLE,
102
+ ],
103
+ )
104
+ @capability(
105
+ SourceCapability.LINEAGE_FINE,
106
+ "Extract column-level lineage",
107
+ subtype_modifier=[
108
+ SourceCapabilityModifier.TABLE,
109
+ ],
110
+ )
94
111
  @capability(SourceCapability.OWNERSHIP, "Enabled by default")
95
112
  @capability(SourceCapability.PLATFORM_INSTANCE, "Enabled by default")
96
113
  @capability(SourceCapability.USAGE_STATS, "Enabled by default to get usage stats")
@@ -16,7 +16,11 @@ from datahub.ingestion.api.decorators import (
16
16
  platform_name,
17
17
  support_status,
18
18
  )
19
- from datahub.ingestion.api.source import MetadataWorkUnitProcessor, SourceReport
19
+ from datahub.ingestion.api.source import (
20
+ MetadataWorkUnitProcessor,
21
+ SourceReport,
22
+ StructuredLogCategory,
23
+ )
20
24
  from datahub.ingestion.api.workunit import MetadataWorkUnit
21
25
  from datahub.ingestion.source.fivetran.config import (
22
26
  KNOWN_DATA_PLATFORM_MAPPING,
@@ -96,8 +100,10 @@ class FivetranSource(StatefulIngestionSourceBase):
96
100
  self.report.info(
97
101
  title="Guessing source platform for lineage",
98
102
  message="We encountered a connector type that we don't fully support yet. "
99
- "We will attempt to guess the platform based on the connector type.",
100
- context=f"{connector.connector_name} (connector_id: {connector.connector_id}, connector_type: {connector.connector_type})",
103
+ "We will attempt to guess the platform based on the connector type. "
104
+ "Note that we use connector_id as the key not connector_name which you may see in the UI of Fivetran. ",
105
+ context=f"connector_name: {connector.connector_name} (connector_id: {connector.connector_id}, connector_type: {connector.connector_type})",
106
+ log_category=StructuredLogCategory.LINEAGE,
101
107
  )
102
108
  source_details.platform = connector.connector_type
103
109
 
@@ -216,6 +216,14 @@ def get_column_unique_count_dh_patch(self: SqlAlchemyDataset, column: str) -> in
216
216
  )
217
217
  ).scalar()
218
218
  )
219
+ elif self.engine.dialect.name.lower() == DATABRICKS:
220
+ return convert_to_json_serializable(
221
+ self.engine.execute(
222
+ sa.select(sa.func.approx_count_distinct(sa.column(column))).select_from(
223
+ self._table
224
+ )
225
+ ).scalar()
226
+ )
219
227
  return convert_to_json_serializable(
220
228
  self.engine.execute(
221
229
  sa.select([sa.func.count(sa.func.distinct(sa.column(column)))]).select_from(
@@ -97,7 +97,7 @@ class HexQueryFetcher:
97
97
  if not query_urns or not entities_by_urn:
98
98
  self.report.warning(
99
99
  title="No Queries found with Hex as origin",
100
- message="No lineage because of no Queries found with Hex as origin in the given time range; you may consider extending the time range to fetch more queries.",
100
+ message="No lineage because of no Queries found with Hex as origin in the given time range. You may need to set use_queries_v2: true on your warehouse ingestion or you may consider extending the time range to fetch more queries.",
101
101
  context=str(
102
102
  dict(
103
103
  workspace_name=self.workspace_name,