acryl-datahub 1.1.1rc4__py3-none-any.whl → 1.2.0.1rc1__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 (223) hide show
  1. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/METADATA +2617 -2590
  2. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/RECORD +223 -189
  3. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/entry_points.txt +2 -0
  4. datahub/_version.py +1 -1
  5. datahub/api/entities/dataset/dataset.py +1 -1
  6. datahub/api/entities/external/__init__.py +0 -0
  7. datahub/api/entities/external/external_entities.py +239 -0
  8. datahub/api/entities/external/external_tag.py +145 -0
  9. datahub/api/entities/external/lake_formation_external_entites.py +161 -0
  10. datahub/api/entities/external/restricted_text.py +247 -0
  11. datahub/api/entities/external/unity_catalog_external_entites.py +173 -0
  12. datahub/cli/check_cli.py +88 -7
  13. datahub/cli/cli_utils.py +63 -0
  14. datahub/cli/container_cli.py +5 -0
  15. datahub/cli/delete_cli.py +124 -27
  16. datahub/cli/docker_check.py +107 -12
  17. datahub/cli/docker_cli.py +149 -227
  18. datahub/cli/exists_cli.py +0 -2
  19. datahub/cli/get_cli.py +0 -2
  20. datahub/cli/iceberg_cli.py +5 -0
  21. datahub/cli/ingest_cli.py +3 -15
  22. datahub/cli/migrate.py +2 -0
  23. datahub/cli/put_cli.py +1 -4
  24. datahub/cli/quickstart_versioning.py +50 -7
  25. datahub/cli/specific/assertions_cli.py +0 -4
  26. datahub/cli/specific/datacontract_cli.py +0 -3
  27. datahub/cli/specific/dataproduct_cli.py +0 -11
  28. datahub/cli/specific/dataset_cli.py +1 -8
  29. datahub/cli/specific/forms_cli.py +0 -4
  30. datahub/cli/specific/group_cli.py +0 -2
  31. datahub/cli/specific/structuredproperties_cli.py +1 -4
  32. datahub/cli/specific/user_cli.py +0 -2
  33. datahub/cli/state_cli.py +0 -2
  34. datahub/cli/timeline_cli.py +0 -2
  35. datahub/configuration/pydantic_migration_helpers.py +7 -5
  36. datahub/emitter/rest_emitter.py +70 -12
  37. datahub/entrypoints.py +4 -3
  38. datahub/ingestion/api/decorators.py +15 -3
  39. datahub/ingestion/api/report.py +332 -3
  40. datahub/ingestion/api/sink.py +3 -0
  41. datahub/ingestion/api/source.py +48 -44
  42. datahub/ingestion/autogenerated/__init__.py +0 -0
  43. datahub/ingestion/autogenerated/capability_summary.json +3449 -0
  44. datahub/ingestion/autogenerated/lineage.json +401 -0
  45. datahub/ingestion/autogenerated/lineage_helper.py +177 -0
  46. datahub/ingestion/extractor/schema_util.py +13 -4
  47. datahub/ingestion/glossary/classification_mixin.py +5 -0
  48. datahub/ingestion/graph/client.py +100 -15
  49. datahub/ingestion/graph/config.py +1 -0
  50. datahub/ingestion/reporting/datahub_ingestion_run_summary_provider.py +20 -10
  51. datahub/ingestion/run/pipeline.py +54 -2
  52. datahub/ingestion/sink/datahub_rest.py +13 -0
  53. datahub/ingestion/source/abs/source.py +1 -1
  54. datahub/ingestion/source/aws/aws_common.py +4 -0
  55. datahub/ingestion/source/aws/glue.py +489 -244
  56. datahub/ingestion/source/aws/tag_entities.py +292 -0
  57. datahub/ingestion/source/azure/azure_common.py +2 -2
  58. datahub/ingestion/source/bigquery_v2/bigquery.py +50 -23
  59. datahub/ingestion/source/bigquery_v2/bigquery_config.py +1 -1
  60. datahub/ingestion/source/bigquery_v2/bigquery_queries.py +1 -0
  61. datahub/ingestion/source/bigquery_v2/bigquery_schema_gen.py +2 -0
  62. datahub/ingestion/source/bigquery_v2/common.py +1 -1
  63. datahub/ingestion/source/bigquery_v2/profiler.py +4 -2
  64. datahub/ingestion/source/bigquery_v2/queries.py +3 -3
  65. datahub/ingestion/source/cassandra/cassandra.py +1 -1
  66. datahub/ingestion/source/cassandra/cassandra_profiling.py +6 -5
  67. datahub/ingestion/source/common/subtypes.py +45 -0
  68. datahub/ingestion/source/data_lake_common/object_store.py +115 -27
  69. datahub/ingestion/source/data_lake_common/path_spec.py +10 -21
  70. datahub/ingestion/source/datahub/datahub_database_reader.py +1 -2
  71. datahub/ingestion/source/dbt/dbt_cloud.py +10 -2
  72. datahub/ingestion/source/dbt/dbt_common.py +6 -2
  73. datahub/ingestion/source/dbt/dbt_core.py +3 -0
  74. datahub/ingestion/source/debug/__init__.py +0 -0
  75. datahub/ingestion/source/debug/datahub_debug.py +300 -0
  76. datahub/ingestion/source/dremio/dremio_api.py +114 -73
  77. datahub/ingestion/source/dremio/dremio_config.py +2 -0
  78. datahub/ingestion/source/dremio/dremio_reporting.py +23 -2
  79. datahub/ingestion/source/dremio/dremio_source.py +94 -81
  80. datahub/ingestion/source/dremio/dremio_sql_queries.py +82 -21
  81. datahub/ingestion/source/file.py +3 -0
  82. datahub/ingestion/source/fivetran/fivetran.py +34 -26
  83. datahub/ingestion/source/gcs/gcs_source.py +13 -2
  84. datahub/ingestion/source/ge_data_profiler.py +76 -28
  85. datahub/ingestion/source/ge_profiling_config.py +11 -0
  86. datahub/ingestion/source/hex/api.py +26 -1
  87. datahub/ingestion/source/iceberg/iceberg.py +3 -1
  88. datahub/ingestion/source/identity/azure_ad.py +1 -1
  89. datahub/ingestion/source/identity/okta.py +1 -14
  90. datahub/ingestion/source/kafka/kafka.py +16 -0
  91. datahub/ingestion/source/kafka_connect/sink_connectors.py +156 -47
  92. datahub/ingestion/source/kafka_connect/source_connectors.py +59 -4
  93. datahub/ingestion/source/looker/looker_source.py +1 -0
  94. datahub/ingestion/source/mlflow.py +11 -1
  95. datahub/ingestion/source/mock_data/__init__.py +0 -0
  96. datahub/ingestion/source/mock_data/datahub_mock_data.py +507 -0
  97. datahub/ingestion/source/mock_data/datahub_mock_data_report.py +12 -0
  98. datahub/ingestion/source/mock_data/table_naming_helper.py +97 -0
  99. datahub/ingestion/source/nifi.py +1 -1
  100. datahub/ingestion/source/powerbi/powerbi.py +1 -5
  101. datahub/ingestion/source/powerbi/rest_api_wrapper/powerbi_api.py +0 -1
  102. datahub/ingestion/source/powerbi_report_server/report_server.py +0 -23
  103. datahub/ingestion/source/preset.py +2 -2
  104. datahub/ingestion/source/qlik_sense/qlik_sense.py +1 -0
  105. datahub/ingestion/source/redshift/redshift.py +21 -1
  106. datahub/ingestion/source/redshift/usage.py +4 -3
  107. datahub/ingestion/source/s3/report.py +4 -2
  108. datahub/ingestion/source/s3/source.py +367 -115
  109. datahub/ingestion/source/sac/sac.py +3 -1
  110. datahub/ingestion/source/salesforce.py +6 -3
  111. datahub/ingestion/source/sigma/sigma.py +7 -1
  112. datahub/ingestion/source/slack/slack.py +2 -1
  113. datahub/ingestion/source/snowflake/snowflake_config.py +30 -7
  114. datahub/ingestion/source/snowflake/snowflake_queries.py +348 -82
  115. datahub/ingestion/source/snowflake/snowflake_summary.py +5 -0
  116. datahub/ingestion/source/snowflake/snowflake_usage_v2.py +8 -2
  117. datahub/ingestion/source/snowflake/snowflake_utils.py +2 -7
  118. datahub/ingestion/source/snowflake/snowflake_v2.py +16 -2
  119. datahub/ingestion/source/snowflake/stored_proc_lineage.py +143 -0
  120. datahub/ingestion/source/sql/athena.py +119 -11
  121. datahub/ingestion/source/sql/athena_properties_extractor.py +777 -0
  122. datahub/ingestion/source/sql/clickhouse.py +3 -1
  123. datahub/ingestion/source/sql/cockroachdb.py +0 -1
  124. datahub/ingestion/source/sql/hana.py +3 -1
  125. datahub/ingestion/source/sql/hive_metastore.py +3 -11
  126. datahub/ingestion/source/sql/mariadb.py +0 -1
  127. datahub/ingestion/source/sql/mssql/source.py +239 -34
  128. datahub/ingestion/source/sql/mysql.py +0 -1
  129. datahub/ingestion/source/sql/oracle.py +1 -1
  130. datahub/ingestion/source/sql/postgres.py +0 -1
  131. datahub/ingestion/source/sql/sql_common.py +121 -34
  132. datahub/ingestion/source/sql/sql_generic_profiler.py +2 -1
  133. datahub/ingestion/source/sql/teradata.py +997 -235
  134. datahub/ingestion/source/sql/vertica.py +10 -6
  135. datahub/ingestion/source/sql_queries.py +2 -2
  136. datahub/ingestion/source/state/stateful_ingestion_base.py +1 -1
  137. datahub/ingestion/source/superset.py +58 -3
  138. datahub/ingestion/source/tableau/tableau.py +58 -37
  139. datahub/ingestion/source/tableau/tableau_common.py +4 -2
  140. datahub/ingestion/source/tableau/tableau_constant.py +0 -4
  141. datahub/ingestion/source/unity/config.py +5 -0
  142. datahub/ingestion/source/unity/proxy.py +118 -0
  143. datahub/ingestion/source/unity/source.py +195 -17
  144. datahub/ingestion/source/unity/tag_entities.py +295 -0
  145. datahub/ingestion/source/usage/clickhouse_usage.py +4 -1
  146. datahub/ingestion/source/usage/starburst_trino_usage.py +3 -0
  147. datahub/ingestion/transformer/add_dataset_ownership.py +18 -2
  148. datahub/integrations/assertion/snowflake/compiler.py +4 -3
  149. datahub/metadata/_internal_schema_classes.py +1522 -569
  150. datahub/metadata/_urns/urn_defs.py +1826 -1658
  151. datahub/metadata/com/linkedin/pegasus2avro/application/__init__.py +19 -0
  152. datahub/metadata/com/linkedin/pegasus2avro/identity/__init__.py +2 -0
  153. datahub/metadata/com/linkedin/pegasus2avro/logical/__init__.py +15 -0
  154. datahub/metadata/com/linkedin/pegasus2avro/metadata/key/__init__.py +4 -0
  155. datahub/metadata/com/linkedin/pegasus2avro/module/__init__.py +29 -0
  156. datahub/metadata/com/linkedin/pegasus2avro/settings/global/__init__.py +4 -0
  157. datahub/metadata/com/linkedin/pegasus2avro/template/__init__.py +25 -0
  158. datahub/metadata/schema.avsc +17758 -17097
  159. datahub/metadata/schemas/ApplicationKey.avsc +31 -0
  160. datahub/metadata/schemas/ApplicationProperties.avsc +72 -0
  161. datahub/metadata/schemas/Applications.avsc +38 -0
  162. datahub/metadata/schemas/ChartKey.avsc +1 -0
  163. datahub/metadata/schemas/ContainerKey.avsc +1 -0
  164. datahub/metadata/schemas/ContainerProperties.avsc +8 -0
  165. datahub/metadata/schemas/CorpUserSettings.avsc +41 -0
  166. datahub/metadata/schemas/DashboardKey.avsc +1 -0
  167. datahub/metadata/schemas/DataFlowInfo.avsc +8 -0
  168. datahub/metadata/schemas/DataFlowKey.avsc +1 -0
  169. datahub/metadata/schemas/DataHubPageModuleKey.avsc +21 -0
  170. datahub/metadata/schemas/DataHubPageModuleProperties.avsc +237 -0
  171. datahub/metadata/schemas/DataHubPageTemplateKey.avsc +21 -0
  172. datahub/metadata/schemas/DataHubPageTemplateProperties.avsc +175 -0
  173. datahub/metadata/schemas/DataHubPolicyInfo.avsc +12 -1
  174. datahub/metadata/schemas/DataJobInfo.avsc +8 -0
  175. datahub/metadata/schemas/DataJobKey.avsc +1 -0
  176. datahub/metadata/schemas/DataProcessKey.avsc +8 -0
  177. datahub/metadata/schemas/DataProductKey.avsc +1 -0
  178. datahub/metadata/schemas/DataProductProperties.avsc +1 -1
  179. datahub/metadata/schemas/DatasetKey.avsc +11 -1
  180. datahub/metadata/schemas/GlobalSettingsInfo.avsc +62 -0
  181. datahub/metadata/schemas/GlossaryTermKey.avsc +1 -0
  182. datahub/metadata/schemas/IcebergWarehouseInfo.avsc +8 -0
  183. datahub/metadata/schemas/LogicalParent.avsc +140 -0
  184. datahub/metadata/schemas/MLFeatureKey.avsc +1 -0
  185. datahub/metadata/schemas/MLFeatureTableKey.avsc +1 -0
  186. datahub/metadata/schemas/MLModelDeploymentKey.avsc +8 -0
  187. datahub/metadata/schemas/MLModelGroupKey.avsc +9 -0
  188. datahub/metadata/schemas/MLModelKey.avsc +9 -0
  189. datahub/metadata/schemas/MLPrimaryKeyKey.avsc +1 -0
  190. datahub/metadata/schemas/MetadataChangeEvent.avsc +20 -1
  191. datahub/metadata/schemas/NotebookKey.avsc +1 -0
  192. datahub/metadata/schemas/QuerySubjects.avsc +1 -12
  193. datahub/metadata/schemas/SchemaFieldKey.avsc +2 -1
  194. datahub/metadata/schemas/__init__.py +3 -3
  195. datahub/sdk/__init__.py +2 -0
  196. datahub/sdk/_all_entities.py +7 -0
  197. datahub/sdk/_shared.py +116 -0
  198. datahub/sdk/chart.py +315 -0
  199. datahub/sdk/container.py +7 -0
  200. datahub/sdk/dashboard.py +432 -0
  201. datahub/sdk/dataflow.py +7 -0
  202. datahub/sdk/datajob.py +45 -13
  203. datahub/sdk/dataset.py +8 -2
  204. datahub/sdk/entity_client.py +82 -2
  205. datahub/sdk/lineage_client.py +683 -82
  206. datahub/sdk/main_client.py +46 -16
  207. datahub/sdk/mlmodel.py +101 -38
  208. datahub/sdk/mlmodelgroup.py +7 -0
  209. datahub/sdk/search_client.py +4 -3
  210. datahub/sdk/search_filters.py +95 -27
  211. datahub/specific/chart.py +1 -1
  212. datahub/specific/dataproduct.py +4 -0
  213. datahub/sql_parsing/sql_parsing_aggregator.py +29 -17
  214. datahub/sql_parsing/sqlglot_lineage.py +62 -13
  215. datahub/telemetry/telemetry.py +17 -11
  216. datahub/testing/sdk_v2_helpers.py +7 -1
  217. datahub/upgrade/upgrade.py +56 -14
  218. datahub/utilities/server_config_util.py +8 -0
  219. datahub/utilities/sqlalchemy_query_combiner.py +5 -2
  220. datahub/utilities/stats_collections.py +4 -0
  221. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/WHEEL +0 -0
  222. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/licenses/LICENSE +0 -0
  223. {acryl_datahub-1.1.1rc4.dist-info → acryl_datahub-1.2.0.1rc1.dist-info}/top_level.txt +0 -0
datahub/cli/ingest_cli.py CHANGED
@@ -24,7 +24,6 @@ from datahub.ingestion.run.pipeline import Pipeline
24
24
  from datahub.telemetry import telemetry
25
25
  from datahub.upgrade import upgrade
26
26
  from datahub.utilities.ingest_utils import deploy_source_vars
27
- from datahub.utilities.perf_timer import PerfTimer
28
27
 
29
28
  logger = logging.getLogger(__name__)
30
29
 
@@ -114,6 +113,7 @@ def ingest() -> None:
114
113
  "no_progress",
115
114
  ]
116
115
  )
116
+ @upgrade.check_upgrade
117
117
  def run(
118
118
  config: str,
119
119
  dry_run: bool,
@@ -178,14 +178,7 @@ def run(
178
178
  no_progress=no_progress,
179
179
  raw_config=raw_pipeline_config,
180
180
  )
181
- with PerfTimer() as timer:
182
- ret = run_pipeline_to_completion(pipeline)
183
-
184
- # The main ingestion has completed. If it was successful, potentially show an upgrade nudge message.
185
- if ret == 0:
186
- upgrade.check_upgrade_post(
187
- main_method_runtime=timer.elapsed_seconds(), graph=pipeline.ctx.graph
188
- )
181
+ ret = run_pipeline_to_completion(pipeline)
189
182
 
190
183
  if ret:
191
184
  sys.exit(ret)
@@ -193,8 +186,6 @@ def run(
193
186
 
194
187
 
195
188
  @ingest.command()
196
- @upgrade.check_upgrade
197
- @telemetry.with_telemetry()
198
189
  @click.option(
199
190
  "-n",
200
191
  "--name",
@@ -252,6 +243,7 @@ def run(
252
243
  required=False,
253
244
  default=None,
254
245
  )
246
+ @upgrade.check_upgrade
255
247
  def deploy(
256
248
  name: Optional[str],
257
249
  config: str,
@@ -386,7 +378,6 @@ def mcps(path: str) -> None:
386
378
  "--source", type=str, default=None, help="Filter by ingestion source name."
387
379
  )
388
380
  @upgrade.check_upgrade
389
- @telemetry.with_telemetry()
390
381
  def list_source_runs(page_offset: int, page_size: int, urn: str, source: str) -> None:
391
382
  """
392
383
  List ingestion source runs with their details, optionally filtered by URN or source.
@@ -515,7 +506,6 @@ def list_source_runs(page_offset: int, page_size: int, urn: str, source: str) ->
515
506
  help="If enabled, will list ingestion runs which have been soft deleted",
516
507
  )
517
508
  @upgrade.check_upgrade
518
- @telemetry.with_telemetry()
519
509
  def list_runs(page_offset: int, page_size: int, include_soft_deletes: bool) -> None:
520
510
  """List recent ingestion runs to datahub"""
521
511
 
@@ -565,7 +555,6 @@ def list_runs(page_offset: int, page_size: int, include_soft_deletes: bool) -> N
565
555
  )
566
556
  @click.option("-a", "--show-aspect", required=False, is_flag=True)
567
557
  @upgrade.check_upgrade
568
- @telemetry.with_telemetry()
569
558
  def show(
570
559
  run_id: str, start: int, count: int, include_soft_deletes: bool, show_aspect: bool
571
560
  ) -> None:
@@ -615,7 +604,6 @@ def show(
615
604
  help="Path to directory where rollback reports will be saved to",
616
605
  )
617
606
  @upgrade.check_upgrade
618
- @telemetry.with_telemetry()
619
607
  def rollback(
620
608
  run_id: str, force: bool, dry_run: bool, safe: bool, report_dir: str
621
609
  ) -> None:
datahub/cli/migrate.py CHANGED
@@ -37,6 +37,7 @@ from datahub.metadata.schema_classes import (
37
37
  SystemMetadataClass,
38
38
  )
39
39
  from datahub.telemetry import telemetry
40
+ from datahub.upgrade import upgrade
40
41
  from datahub.utilities.urns.urn import Urn
41
42
 
42
43
  log = logging.getLogger(__name__)
@@ -119,6 +120,7 @@ def _get_type_from_urn(urn: str) -> str:
119
120
  help="When enabled, will not delete (hard/soft) the previous entities.",
120
121
  )
121
122
  @telemetry.with_telemetry()
123
+ @upgrade.check_upgrade
122
124
  def dataplatform2instance(
123
125
  instance: str,
124
126
  platform: str,
datahub/cli/put_cli.py CHANGED
@@ -14,7 +14,6 @@ from datahub.metadata.schema_classes import (
14
14
  PlatformTypeClass,
15
15
  SystemMetadataClass,
16
16
  )
17
- from datahub.telemetry import telemetry
18
17
  from datahub.upgrade import upgrade
19
18
  from datahub.utilities.urns.data_platform_urn import DataPlatformUrn
20
19
  from datahub.utilities.urns.urn import guess_entity_type
@@ -45,7 +44,6 @@ def put() -> None:
45
44
  help="Run ID into which we should log the aspect.",
46
45
  )
47
46
  @upgrade.check_upgrade
48
- @telemetry.with_telemetry()
49
47
  def aspect(urn: str, aspect: str, aspect_data: str, run_id: Optional[str]) -> None:
50
48
  """Update a single aspect of an entity"""
51
49
 
@@ -75,8 +73,6 @@ def aspect(urn: str, aspect: str, aspect_data: str, run_id: Optional[str]) -> No
75
73
 
76
74
  @put.command()
77
75
  @click.pass_context
78
- @upgrade.check_upgrade
79
- @telemetry.with_telemetry()
80
76
  @click.option(
81
77
  "--name",
82
78
  type=str,
@@ -98,6 +94,7 @@ def aspect(urn: str, aspect: str, aspect_data: str, run_id: Optional[str]) -> No
98
94
  @click.option(
99
95
  "--run-id", type=str, help="Run ID into which we should log the platform."
100
96
  )
97
+ @upgrade.check_upgrade
101
98
  def platform(
102
99
  ctx: click.Context, name: str, display_name: Optional[str], logo: str, run_id: str
103
100
  ) -> None:
@@ -6,17 +6,40 @@ import re
6
6
  from typing import Dict, Optional
7
7
 
8
8
  import click
9
+ import packaging
9
10
  import requests
10
11
  import yaml
11
12
  from packaging.version import parse
12
13
  from pydantic import BaseModel
13
14
 
15
+ from datahub._version import nice_version_name
16
+
14
17
  logger = logging.getLogger(__name__)
15
18
 
16
19
  LOCAL_QUICKSTART_MAPPING_FILE = os.environ.get("FORCE_LOCAL_QUICKSTART_MAPPING", "")
17
20
  DEFAULT_LOCAL_CONFIG_PATH = "~/.datahub/quickstart/quickstart_version_mapping.yaml"
18
21
  DEFAULT_REMOTE_CONFIG_PATH = "https://raw.githubusercontent.com/datahub-project/datahub/master/docker/quickstart/quickstart_version_mapping.yaml"
19
22
 
23
+ MINIMUM_SUPPORTED_VERSION = "v1.1.0"
24
+
25
+
26
+ def get_minimum_supported_version_message(version: str) -> str:
27
+ MINIMUM_SUPPORTED_VERSION_MESSAGE = f"""
28
+ DataHub CLI Version Compatibility Issue
29
+
30
+ You're trying to install DataHub server version {version} which is not supported by this CLI version.
31
+
32
+ This CLI (version {nice_version_name()}) only supports installing DataHub server versions {MINIMUM_SUPPORTED_VERSION} and above.
33
+
34
+ To install older server versions:
35
+ 1. Uninstall current CLI: pip uninstall acryl-datahub
36
+ 2. Install older CLI: pip install acryl-datahub==1.1
37
+ 3. Run quickstart with your desired version: datahub docker quickstart --version <version>
38
+
39
+ For more information: https://docs.datahub.com/docs/quickstart#install-datahub-server
40
+ """
41
+ return MINIMUM_SUPPORTED_VERSION_MESSAGE
42
+
20
43
 
21
44
  class QuickstartExecutionPlan(BaseModel):
22
45
  composefile_git_ref: str
@@ -126,15 +149,23 @@ class QuickstartVersionMappingConfig(BaseModel):
126
149
  mysql_tag=str(mysql_tag),
127
150
  ),
128
151
  )
152
+
153
+ if not is_minimum_supported_version(requested_version):
154
+ click.secho(
155
+ get_minimum_supported_version_message(version=requested_version),
156
+ fg="red",
157
+ )
158
+ raise click.ClickException("Minimum supported version not met")
159
+
129
160
  # new CLI version is downloading the composefile corresponding to the requested version
130
- # if the version is older than v0.10.1, it doesn't contain the setup job labels and the
131
- # the checks will fail, so in those cases we pick the composefile from v0.10.1 which contains
132
- # the setup job labels
161
+ # if the version is older than <MINIMUM_SUPPORTED_VERSION>, it doesn't contain the
162
+ # docker compose based resolved compose file. In those cases, we pick up the composefile from
163
+ # MINIMUM_SUPPORTED_VERSION which contains the compose file.
133
164
  if _is_it_a_version(result.composefile_git_ref):
134
- if parse("v0.10.1") > parse(result.composefile_git_ref):
135
- # The merge commit where the labels were added
136
- # https://github.com/datahub-project/datahub/pull/7473
137
- result.composefile_git_ref = "1d3339276129a7cb8385c07a958fcc93acda3b4e"
165
+ if parse("v1.2.0") > parse(result.composefile_git_ref):
166
+ # The merge commit where profiles based resolved compose file was added.
167
+ # https://github.com/datahub-project/datahub/pull/13566
168
+ result.composefile_git_ref = "21726bc3341490f4182b904626c793091ac95edd"
138
169
 
139
170
  return result
140
171
 
@@ -148,3 +179,15 @@ def save_quickstart_config(
148
179
  with open(path, "w") as f:
149
180
  yaml.dump(config.dict(), f)
150
181
  logger.info(f"Saved quickstart config to {path}.")
182
+
183
+
184
+ def is_minimum_supported_version(version: str) -> bool:
185
+ if not _is_it_a_version(version):
186
+ return True
187
+
188
+ requested_version = packaging.version.parse(version)
189
+ minimum_supported_version = packaging.version.parse(MINIMUM_SUPPORTED_VERSION)
190
+ if requested_version < minimum_supported_version:
191
+ return False
192
+
193
+ return True
@@ -17,7 +17,6 @@ from datahub.emitter.mcp import MetadataChangeProposalWrapper
17
17
  from datahub.ingestion.graph.client import get_default_graph
18
18
  from datahub.ingestion.graph.config import ClientMode
19
19
  from datahub.integrations.assertion.registry import ASSERTION_PLATFORMS
20
- from datahub.telemetry import telemetry
21
20
  from datahub.upgrade import upgrade
22
21
 
23
22
  logger = logging.getLogger(__name__)
@@ -34,7 +33,6 @@ def assertions() -> None:
34
33
  @assertions.command()
35
34
  @click.option("-f", "--file", required=True, type=click.Path(exists=True))
36
35
  @upgrade.check_upgrade
37
- @telemetry.with_telemetry()
38
36
  def upsert(file: str) -> None:
39
37
  """Upsert (create or update) a set of assertions in DataHub."""
40
38
 
@@ -71,8 +69,6 @@ def upsert(file: str) -> None:
71
69
  default=[],
72
70
  help="Platform-specific extra key-value inputs in form key=value",
73
71
  )
74
- @upgrade.check_upgrade
75
- @telemetry.with_telemetry()
76
72
  def compile(
77
73
  file: str, platform: str, output_to: Optional[str], extras: List[str]
78
74
  ) -> None:
@@ -7,7 +7,6 @@ from click_default_group import DefaultGroup
7
7
  from datahub.api.entities.datacontract.datacontract import DataContract
8
8
  from datahub.ingestion.graph.client import get_default_graph
9
9
  from datahub.ingestion.graph.config import ClientMode
10
- from datahub.telemetry import telemetry
11
10
  from datahub.upgrade import upgrade
12
11
 
13
12
  logger = logging.getLogger(__name__)
@@ -22,7 +21,6 @@ def datacontract() -> None:
22
21
  @datacontract.command()
23
22
  @click.option("-f", "--file", required=True, type=click.Path(exists=True))
24
23
  @upgrade.check_upgrade
25
- @telemetry.with_telemetry()
26
24
  def upsert(file: str) -> None:
27
25
  """Upsert (create or update) a Data Contract in DataHub."""
28
26
 
@@ -60,7 +58,6 @@ def upsert(file: str) -> None:
60
58
  )
61
59
  @click.option("--hard/--soft", required=False, is_flag=True, default=False)
62
60
  @upgrade.check_upgrade
63
- @telemetry.with_telemetry()
64
61
  def delete(urn: Optional[str], file: Optional[str], hard: bool) -> None:
65
62
  """Delete a Data Contract in DataHub. Defaults to a soft-delete. Use --hard to completely erase metadata."""
66
63
 
@@ -23,7 +23,6 @@ from datahub.ingestion.graph.client import DataHubGraph, get_default_graph
23
23
  from datahub.ingestion.graph.config import ClientMode
24
24
  from datahub.metadata.schema_classes import OwnerClass, OwnershipTypeClass
25
25
  from datahub.specific.dataproduct import DataProductPatchBuilder
26
- from datahub.telemetry import telemetry
27
26
  from datahub.upgrade import upgrade
28
27
  from datahub.utilities.urns.urn import Urn
29
28
 
@@ -130,7 +129,6 @@ def mutate(file: Path, validate_assets: bool, external_url: str, upsert: bool) -
130
129
  )
131
130
  @click.option("--external-url", required=False, type=str)
132
131
  @upgrade.check_upgrade
133
- @telemetry.with_telemetry()
134
132
  def update(file: Path, validate_assets: bool, external_url: str) -> None:
135
133
  """Create or Update a Data Product in DataHub. Use upsert if you want to apply partial updates."""
136
134
 
@@ -146,7 +144,6 @@ def update(file: Path, validate_assets: bool, external_url: str) -> None:
146
144
  )
147
145
  @click.option("--external-url", required=False, type=str)
148
146
  @upgrade.check_upgrade
149
- @telemetry.with_telemetry()
150
147
  def upsert(file: Path, validate_assets: bool, external_url: str) -> None:
151
148
  """Upsert attributes to a Data Product in DataHub."""
152
149
 
@@ -159,7 +156,6 @@ def upsert(file: Path, validate_assets: bool, external_url: str) -> None:
159
156
  @click.option("-f", "--file", required=True, type=click.Path(exists=True))
160
157
  @click.option("--update", required=False, is_flag=True, default=False)
161
158
  @upgrade.check_upgrade
162
- @telemetry.with_telemetry()
163
159
  def diff(file: Path, update: bool) -> None:
164
160
  """Diff a Data Product file with its twin in DataHub"""
165
161
 
@@ -206,7 +202,6 @@ def diff(file: Path, update: bool) -> None:
206
202
  )
207
203
  @click.option("--hard/--soft", required=False, is_flag=True, default=False)
208
204
  @upgrade.check_upgrade
209
- @telemetry.with_telemetry()
210
205
  def delete(urn: str, file: Path, hard: bool) -> None:
211
206
  """Delete a Data Product in DataHub. Defaults to a soft-delete. Use --hard to completely erase metadata."""
212
207
 
@@ -242,7 +237,6 @@ def delete(urn: str, file: Path, hard: bool) -> None:
242
237
  @click.option("--urn", required=True, type=str)
243
238
  @click.option("--to-file", required=False, type=str)
244
239
  @upgrade.check_upgrade
245
- @telemetry.with_telemetry()
246
240
  def get(urn: str, to_file: str) -> None:
247
241
  """Get a Data Product from DataHub"""
248
242
 
@@ -279,7 +273,6 @@ def get(urn: str, to_file: str) -> None:
279
273
  help="A markdown file that contains documentation for this data product",
280
274
  )
281
275
  @upgrade.check_upgrade
282
- @telemetry.with_telemetry()
283
276
  def set_description(urn: str, description: str, md_file: Path) -> None:
284
277
  """Set description for a Data Product in DataHub"""
285
278
 
@@ -330,7 +323,6 @@ def set_description(urn: str, description: str, md_file: Path) -> None:
330
323
  default=OwnershipTypeClass.TECHNICAL_OWNER,
331
324
  )
332
325
  @upgrade.check_upgrade
333
- @telemetry.with_telemetry()
334
326
  def add_owner(urn: str, owner: str, owner_type: str) -> None:
335
327
  """Add owner for a Data Product in DataHub"""
336
328
 
@@ -353,7 +345,6 @@ def add_owner(urn: str, owner: str, owner_type: str) -> None:
353
345
  @click.option("--urn", required=True, type=str)
354
346
  @click.argument("owner_urn", required=True, type=str)
355
347
  @upgrade.check_upgrade
356
- @telemetry.with_telemetry()
357
348
  def remove_owner(urn: str, owner_urn: str) -> None:
358
349
  """Remove owner for a Data Product in DataHub"""
359
350
 
@@ -375,7 +366,6 @@ def remove_owner(urn: str, owner_urn: str) -> None:
375
366
  "--validate-assets/--no-validate-assets", required=False, is_flag=True, default=True
376
367
  )
377
368
  @upgrade.check_upgrade
378
- @telemetry.with_telemetry()
379
369
  def add_asset(urn: str, asset: str, validate_assets: bool) -> None:
380
370
  """Add asset for a Data Product in DataHub"""
381
371
 
@@ -402,7 +392,6 @@ def add_asset(urn: str, asset: str, validate_assets: bool) -> None:
402
392
  "--validate-assets/--no-validate-assets", required=False, is_flag=True, default=True
403
393
  )
404
394
  @upgrade.check_upgrade
405
- @telemetry.with_telemetry()
406
395
  def remove_asset(urn: str, asset: str, validate_assets: bool) -> None:
407
396
  """Remove asset for a Data Product in DataHub"""
408
397
 
@@ -14,7 +14,6 @@ from datahub.emitter.mcp import MetadataChangeProposalWrapper
14
14
  from datahub.ingestion.graph.client import DataHubGraph, get_default_graph
15
15
  from datahub.ingestion.graph.config import ClientMode
16
16
  from datahub.metadata.com.linkedin.pegasus2avro.common import Siblings
17
- from datahub.telemetry import telemetry
18
17
  from datahub.upgrade import upgrade
19
18
 
20
19
  logger = logging.getLogger(__name__)
@@ -33,8 +32,6 @@ def dataset() -> None:
33
32
  @click.option(
34
33
  "-n", "--dry-run", type=bool, is_flag=True, default=False, help="Perform a dry run"
35
34
  )
36
- @upgrade.check_upgrade
37
- @telemetry.with_telemetry()
38
35
  def upsert(file: Path, dry_run: bool) -> None:
39
36
  """Upsert attributes to a Dataset in DataHub."""
40
37
  # Call the sync command with to_datahub=True to perform the upsert operation
@@ -48,7 +45,6 @@ def upsert(file: Path, dry_run: bool) -> None:
48
45
  @click.option("--urn", required=True, type=str)
49
46
  @click.option("--to-file", required=False, type=str)
50
47
  @upgrade.check_upgrade
51
- @telemetry.with_telemetry()
52
48
  def get(urn: str, to_file: str) -> None:
53
49
  """Get a Dataset from DataHub"""
54
50
 
@@ -77,7 +73,7 @@ def get(urn: str, to_file: str) -> None:
77
73
  help="URN of secondary sibling(s)",
78
74
  multiple=True,
79
75
  )
80
- @telemetry.with_telemetry()
76
+ @upgrade.check_upgrade
81
77
  def add_sibling(urn: str, sibling_urns: Tuple[str]) -> None:
82
78
  all_urns = set()
83
79
  all_urns.add(urn)
@@ -117,8 +113,6 @@ def _get_existing_siblings(graph: DataHubGraph, urn: str) -> Set[str]:
117
113
  @click.option("--lintCheck", required=False, is_flag=True)
118
114
  @click.option("--lintFix", required=False, is_flag=True)
119
115
  @click.argument("file", type=click.Path(exists=True))
120
- @upgrade.check_upgrade
121
- @telemetry.with_telemetry()
122
116
  def file(lintcheck: bool, lintfix: bool, file: str) -> None:
123
117
  """Operate on a Dataset file"""
124
118
 
@@ -175,7 +169,6 @@ def file(lintcheck: bool, lintfix: bool, file: str) -> None:
175
169
  "-n", "--dry-run", type=bool, is_flag=True, default=False, help="Perform a dry run"
176
170
  )
177
171
  @upgrade.check_upgrade
178
- @telemetry.with_telemetry()
179
172
  def sync(file: str, to_datahub: bool, dry_run: bool) -> None:
180
173
  """Sync a Dataset file to/from DataHub"""
181
174
 
@@ -8,7 +8,6 @@ from click_default_group import DefaultGroup
8
8
  from datahub.api.entities.forms.forms import Forms
9
9
  from datahub.ingestion.graph.client import get_default_graph
10
10
  from datahub.ingestion.graph.config import ClientMode
11
- from datahub.telemetry import telemetry
12
11
  from datahub.upgrade import upgrade
13
12
 
14
13
  logger = logging.getLogger(__name__)
@@ -24,8 +23,6 @@ def forms() -> None:
24
23
  name="upsert",
25
24
  )
26
25
  @click.option("-f", "--file", required=True, type=click.Path(exists=True))
27
- @upgrade.check_upgrade
28
- @telemetry.with_telemetry()
29
26
  def upsert(file: Path) -> None:
30
27
  """Upsert forms in DataHub."""
31
28
 
@@ -38,7 +35,6 @@ def upsert(file: Path) -> None:
38
35
  @click.option("--urn", required=True, type=str)
39
36
  @click.option("--to-file", required=False, type=str)
40
37
  @upgrade.check_upgrade
41
- @telemetry.with_telemetry()
42
38
  def get(urn: str, to_file: str) -> None:
43
39
  """Get form from DataHub"""
44
40
  with get_default_graph(ClientMode.CLI) as graph:
@@ -11,7 +11,6 @@ from datahub.api.entities.corpgroup.corpgroup import (
11
11
  from datahub.cli.specific.file_loader import load_file
12
12
  from datahub.ingestion.graph.client import get_default_graph
13
13
  from datahub.ingestion.graph.config import ClientMode
14
- from datahub.telemetry import telemetry
15
14
  from datahub.upgrade import upgrade
16
15
 
17
16
  logger = logging.getLogger(__name__)
@@ -35,7 +34,6 @@ def group() -> None:
35
34
  help="When set, writes to the editable section of the metadata graph, overwriting writes from the UI",
36
35
  )
37
36
  @upgrade.check_upgrade
38
- @telemetry.with_telemetry()
39
37
  def upsert(file: Path, override_editable: bool) -> None:
40
38
  """Create or Update a Group with embedded Users"""
41
39
 
@@ -12,7 +12,6 @@ from datahub.api.entities.structuredproperties.structuredproperties import (
12
12
  )
13
13
  from datahub.ingestion.graph.client import get_default_graph
14
14
  from datahub.ingestion.graph.config import ClientMode
15
- from datahub.telemetry import telemetry
16
15
  from datahub.upgrade import upgrade
17
16
  from datahub.utilities.urns.urn import Urn
18
17
 
@@ -30,7 +29,6 @@ def properties() -> None:
30
29
  )
31
30
  @click.option("-f", "--file", required=True, type=click.Path(exists=True))
32
31
  @upgrade.check_upgrade
33
- @telemetry.with_telemetry()
34
32
  def upsert(file: Path) -> None:
35
33
  """Upsert structured properties in DataHub."""
36
34
 
@@ -44,7 +42,6 @@ def upsert(file: Path) -> None:
44
42
  @click.option("--urn", required=True, type=str)
45
43
  @click.option("--to-file", required=False, type=str)
46
44
  @upgrade.check_upgrade
47
- @telemetry.with_telemetry()
48
45
  def get(urn: str, to_file: str) -> None:
49
46
  """Get structured properties from DataHub"""
50
47
  urn = Urn.make_structured_property_urn(urn)
@@ -71,7 +68,7 @@ def get(urn: str, to_file: str) -> None:
71
68
  )
72
69
  @click.option("--details/--no-details", is_flag=True, default=True)
73
70
  @click.option("--to-file", required=False, type=str)
74
- @telemetry.with_telemetry()
71
+ @upgrade.check_upgrade
75
72
  def list(details: bool, to_file: str) -> None:
76
73
  """List structured properties in DataHub"""
77
74
 
@@ -9,7 +9,6 @@ from datahub.api.entities.corpuser.corpuser import CorpUser, CorpUserGenerationC
9
9
  from datahub.cli.specific.file_loader import load_file
10
10
  from datahub.ingestion.graph.client import get_default_graph
11
11
  from datahub.ingestion.graph.config import ClientMode
12
- from datahub.telemetry import telemetry
13
12
  from datahub.upgrade import upgrade
14
13
 
15
14
  logger = logging.getLogger(__name__)
@@ -33,7 +32,6 @@ def user() -> None:
33
32
  help="Use this flag to overwrite the information that is set via the UI",
34
33
  )
35
34
  @upgrade.check_upgrade
36
- @telemetry.with_telemetry()
37
35
  def upsert(file: Path, override_editable: bool) -> None:
38
36
  """Create or Update a User in DataHub"""
39
37
 
datahub/cli/state_cli.py CHANGED
@@ -6,7 +6,6 @@ from click_default_group import DefaultGroup
6
6
 
7
7
  from datahub.ingestion.graph.client import get_default_graph
8
8
  from datahub.ingestion.graph.config import ClientMode
9
- from datahub.telemetry import telemetry
10
9
  from datahub.upgrade import upgrade
11
10
 
12
11
  logger = logging.getLogger(__name__)
@@ -22,7 +21,6 @@ def state() -> None:
22
21
  @click.option("--pipeline-name", required=True, type=str)
23
22
  @click.option("--platform", required=True, type=str)
24
23
  @upgrade.check_upgrade
25
- @telemetry.with_telemetry()
26
24
  def inspect(pipeline_name: str, platform: str) -> None:
27
25
  """
28
26
  Get the latest stateful ingestion state for a given pipeline.
@@ -10,7 +10,6 @@ from requests import Response
10
10
  from datahub.emitter.mce_builder import dataset_urn_to_key, schema_field_urn_to_key
11
11
  from datahub.ingestion.graph.client import DataHubGraph, get_default_graph
12
12
  from datahub.ingestion.graph.config import ClientMode
13
- from datahub.telemetry import telemetry
14
13
  from datahub.upgrade import upgrade
15
14
  from datahub.utilities.urns.urn import Urn
16
15
 
@@ -130,7 +129,6 @@ def get_timeline(
130
129
  @click.option("--raw", type=bool, is_flag=True, help="Show the raw diff")
131
130
  @click.pass_context
132
131
  @upgrade.check_upgrade
133
- @telemetry.with_telemetry()
134
132
  def timeline(
135
133
  ctx: Any,
136
134
  urn: str,
@@ -1,12 +1,13 @@
1
1
  import pydantic.version
2
2
  from packaging.version import Version
3
3
 
4
- PYDANTIC_VERSION_2: bool
5
- if Version(pydantic.version.VERSION) >= Version("2.0"):
6
- PYDANTIC_VERSION_2 = True
7
- else:
8
- PYDANTIC_VERSION_2 = False
4
+ _pydantic_version = Version(pydantic.version.VERSION)
5
+
6
+ PYDANTIC_VERSION_2 = _pydantic_version >= Version("2.0")
9
7
 
8
+ # The pydantic.Discriminator type was added in v2.5.0.
9
+ # https://docs.pydantic.dev/latest/changelog/#v250-2023-11-13
10
+ PYDANTIC_SUPPORTS_CALLABLE_DISCRIMINATOR = _pydantic_version >= Version("2.5.0")
10
11
 
11
12
  # This can be used to silence deprecation warnings while we migrate.
12
13
  if PYDANTIC_VERSION_2:
@@ -50,6 +51,7 @@ class v1_ConfigModel(v1_BaseModel):
50
51
 
51
52
  __all__ = [
52
53
  "PYDANTIC_VERSION_2",
54
+ "PYDANTIC_SUPPORTS_CALLABLE_DISCRIMINATOR",
53
55
  "PydanticDeprecatedSince20",
54
56
  "GenericModel",
55
57
  "v1_ConfigModel",