acryl-datahub-cloud 0.3.7.9.1__py3-none-any.whl → 0.3.8__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-cloud might be problematic. Click here for more details.

Files changed (64) hide show
  1. acryl_datahub_cloud/_codegen_config.json +1 -1
  2. acryl_datahub_cloud/acryl_cs_issues/source.py +0 -1
  3. acryl_datahub_cloud/api/__init__.py +1 -0
  4. acryl_datahub_cloud/api/client.py +6 -0
  5. acryl_datahub_cloud/api/entity_versioning.py +167 -0
  6. acryl_datahub_cloud/datahub_metadata_sharing/__init__.py +0 -0
  7. acryl_datahub_cloud/datahub_metadata_sharing/metadata_sharing_source.py +267 -0
  8. acryl_datahub_cloud/datahub_metadata_sharing/query.py +7 -0
  9. acryl_datahub_cloud/datahub_metadata_sharing/scroll_shared_entities.gql +204 -0
  10. acryl_datahub_cloud/datahub_metadata_sharing/share_entity.gql +9 -0
  11. acryl_datahub_cloud/datahub_reporting/datahub_dataset.py +0 -2
  12. acryl_datahub_cloud/datahub_reporting/datahub_form_reporting.py +0 -1
  13. acryl_datahub_cloud/datahub_reporting/extract_graph.py +0 -1
  14. acryl_datahub_cloud/datahub_reporting/extract_sql.py +0 -1
  15. acryl_datahub_cloud/datahub_usage_reporting/query_builder.py +79 -57
  16. acryl_datahub_cloud/datahub_usage_reporting/usage_feature_reporter.py +284 -258
  17. acryl_datahub_cloud/lineage_features/source.py +22 -5
  18. acryl_datahub_cloud/metadata/_urns/urn_defs.py +1593 -1494
  19. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/common/__init__.py +6 -0
  20. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/executor/__init__.py +15 -0
  21. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/metadata/key/__init__.py +4 -0
  22. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/versionset/__init__.py +17 -0
  23. acryl_datahub_cloud/metadata/schema.avsc +20140 -19735
  24. acryl_datahub_cloud/metadata/schema_classes.py +1083 -486
  25. acryl_datahub_cloud/metadata/schemas/AssertionAnalyticsRunEvent.avsc +1 -1
  26. acryl_datahub_cloud/metadata/schemas/AssertionInferenceDetails.avsc +1 -1
  27. acryl_datahub_cloud/metadata/schemas/AssertionInfo.avsc +1 -1
  28. acryl_datahub_cloud/metadata/schemas/AssertionRunEvent.avsc +1 -1
  29. acryl_datahub_cloud/metadata/schemas/ContainerKey.avsc +1 -0
  30. acryl_datahub_cloud/metadata/schemas/DataFlowKey.avsc +1 -0
  31. acryl_datahub_cloud/metadata/schemas/DataHubIngestionSourceInfo.avsc +6 -0
  32. acryl_datahub_cloud/metadata/schemas/DataHubViewInfo.avsc +2 -0
  33. acryl_datahub_cloud/metadata/schemas/DataJobKey.avsc +3 -1
  34. acryl_datahub_cloud/metadata/schemas/DataProcessInstanceInput.avsc +2 -4
  35. acryl_datahub_cloud/metadata/schemas/DataProcessInstanceOutput.avsc +0 -2
  36. acryl_datahub_cloud/metadata/schemas/DataTransformLogic.avsc +63 -0
  37. acryl_datahub_cloud/metadata/schemas/DatasetKey.avsc +2 -1
  38. acryl_datahub_cloud/metadata/schemas/Deprecation.avsc +12 -0
  39. acryl_datahub_cloud/metadata/schemas/DynamicFormAssignment.avsc +2 -0
  40. acryl_datahub_cloud/metadata/schemas/EntityTypeKey.avsc +1 -0
  41. acryl_datahub_cloud/metadata/schemas/ExecutionRequestInput.avsc +9 -0
  42. acryl_datahub_cloud/metadata/schemas/ExecutionRequestResult.avsc +14 -0
  43. acryl_datahub_cloud/metadata/schemas/Filter.avsc +2 -0
  44. acryl_datahub_cloud/metadata/schemas/MLFeatureProperties.avsc +51 -0
  45. acryl_datahub_cloud/metadata/schemas/MLModelDeploymentProperties.avsc +51 -0
  46. acryl_datahub_cloud/metadata/schemas/MLModelGroupProperties.avsc +51 -0
  47. acryl_datahub_cloud/metadata/schemas/MLModelKey.avsc +2 -1
  48. acryl_datahub_cloud/metadata/schemas/MLModelProperties.avsc +51 -0
  49. acryl_datahub_cloud/metadata/schemas/MLPrimaryKeyProperties.avsc +51 -0
  50. acryl_datahub_cloud/metadata/schemas/MetadataChangeEvent.avsc +20 -0
  51. acryl_datahub_cloud/metadata/schemas/MonitorInfo.avsc +10 -1
  52. acryl_datahub_cloud/metadata/schemas/PostInfo.avsc +23 -0
  53. acryl_datahub_cloud/metadata/schemas/RecommendationModule.avsc +2 -0
  54. acryl_datahub_cloud/metadata/schemas/RemoteExecutorKey.avsc +21 -0
  55. acryl_datahub_cloud/metadata/schemas/RemoteExecutorStatus.avsc +80 -0
  56. acryl_datahub_cloud/metadata/schemas/SchemaFieldKey.avsc +2 -1
  57. acryl_datahub_cloud/metadata/schemas/VersionProperties.avsc +216 -0
  58. acryl_datahub_cloud/metadata/schemas/VersionSetKey.avsc +26 -0
  59. acryl_datahub_cloud/metadata/schemas/VersionSetProperties.avsc +49 -0
  60. {acryl_datahub_cloud-0.3.7.9.1.dist-info → acryl_datahub_cloud-0.3.8.dist-info}/METADATA +52 -44
  61. {acryl_datahub_cloud-0.3.7.9.1.dist-info → acryl_datahub_cloud-0.3.8.dist-info}/RECORD +64 -48
  62. {acryl_datahub_cloud-0.3.7.9.1.dist-info → acryl_datahub_cloud-0.3.8.dist-info}/entry_points.txt +1 -0
  63. {acryl_datahub_cloud-0.3.7.9.1.dist-info → acryl_datahub_cloud-0.3.8.dist-info}/WHEEL +0 -0
  64. {acryl_datahub_cloud-0.3.7.9.1.dist-info → acryl_datahub_cloud-0.3.8.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acryl-datahub-cloud",
3
- "version": "0.3.7.9.1",
3
+ "version": "0.3.8",
4
4
  "install_requires": [
5
5
  "avro-gen3==0.7.16",
6
6
  "acryl-datahub"
@@ -100,7 +100,6 @@ class AcrylCSIssuesSource(Source):
100
100
  def _provision_platform(
101
101
  self, platform: str, logo_url: str, graph: DataHubGraph
102
102
  ) -> None:
103
-
104
103
  platform_urn = make_data_platform_urn(platform)
105
104
  if not graph.exists(platform_urn):
106
105
  platform_info = DataPlatformInfoClass(
@@ -0,0 +1 @@
1
+ from acryl_datahub_cloud.api.client import AcrylGraph
@@ -0,0 +1,6 @@
1
+ from acryl_datahub_cloud.api.entity_versioning import EntityVersioningAPI
2
+ from datahub.ingestion.graph.client import DataHubGraph
3
+
4
+
5
+ class AcrylGraph(EntityVersioningAPI, DataHubGraph):
6
+ pass
@@ -0,0 +1,167 @@
1
+ import uuid
2
+ from typing import Optional
3
+
4
+ from datahub.ingestion.graph.client import DataHubGraph
5
+ from datahub.metadata.schema_classes import (
6
+ VersionPropertiesClass,
7
+ VersionSetPropertiesClass,
8
+ )
9
+ from datahub.metadata.urns import VersionSetUrn
10
+ from datahub.utilities.urns.urn import guess_entity_type
11
+
12
+
13
+ class EntityVersioningAPI(DataHubGraph):
14
+ LINK_VERSION_MUTATION = """
15
+ mutation($input: LinkVersionInput!) {
16
+ linkAssetVersion(input: $input)
17
+ }
18
+ """
19
+
20
+ UNLINK_VERSION_MUTATION = """
21
+ mutation($input: UnlinkVersionInput!) {
22
+ unlinkAssetVersion(input: $input)
23
+ }
24
+ """
25
+
26
+ def link_asset_to_version_set(
27
+ self,
28
+ asset_urn: str,
29
+ version_set_urn: Optional[str],
30
+ label: str,
31
+ *,
32
+ comment: Optional[str] = None,
33
+ ) -> str:
34
+ """Sets an entity as the latest version of a version set.
35
+
36
+ Can also be used to create a new version set, with `asset_urn` as the first version.
37
+
38
+ Args:
39
+ asset_urn: URN of the entity.
40
+ version_set_urn: URN of the version set, or None to generate a new version set urn
41
+ label: Label of the version.
42
+ comment: Comment about the version.
43
+
44
+ Returns:
45
+ URN of the version set to which `asset_urn` was linked.
46
+ """
47
+
48
+ entity_type = guess_entity_type(asset_urn)
49
+ if version_set_urn is None:
50
+ version_set_urn = VersionSetUrn(str(uuid.uuid4()), entity_type).urn()
51
+ elif guess_entity_type(version_set_urn) != "versionSet":
52
+ raise ValueError(f"Expected version set URN, got {version_set_urn}")
53
+
54
+ entity_version = self.get_aspect(asset_urn, VersionPropertiesClass)
55
+ if entity_version:
56
+ raise ValueError(
57
+ f"Asset {asset_urn} is already a version of {entity_version.versionSet}"
58
+ )
59
+
60
+ variables = {
61
+ "input": {
62
+ "versionSet": version_set_urn,
63
+ "linkedEntity": asset_urn,
64
+ "version": label,
65
+ "comment": comment,
66
+ }
67
+ }
68
+ self.execute_graphql(self.LINK_VERSION_MUTATION, variables)
69
+ return version_set_urn
70
+
71
+ def link_asset_to_versioned_asset(
72
+ self,
73
+ new_asset_urn: str,
74
+ old_asset_urn: str,
75
+ label: str,
76
+ *,
77
+ comment: Optional[str] = None,
78
+ ) -> str:
79
+ """Sets an entity as the latest version of an existing versioned entity.
80
+
81
+ Args:
82
+ new_asset_urn: URN of the new latest entity.
83
+ old_asset_urn: URN of an existing versioned entity to link onto.
84
+ label: Label of the version.
85
+ comment: Comment about the version.
86
+
87
+ Returns:
88
+ URN of the version set to which `new_asset_urn` was linked.
89
+ """
90
+
91
+ new_entity_type = guess_entity_type(new_asset_urn)
92
+ old_entity_type = guess_entity_type(old_asset_urn)
93
+ if new_entity_type != old_entity_type:
94
+ raise ValueError(
95
+ f"Expected URNs of the same type, got {new_entity_type} and {old_entity_type}"
96
+ )
97
+
98
+ new_entity_version = self.get_aspect(new_asset_urn, VersionPropertiesClass)
99
+ if new_entity_version:
100
+ raise ValueError(
101
+ f"Asset {new_asset_urn} is already a version of {new_entity_version.versionSet}"
102
+ )
103
+ old_entity_version = self.get_aspect(old_asset_urn, VersionPropertiesClass)
104
+ if not old_entity_version:
105
+ raise ValueError(f"Asset {old_asset_urn} is not versioned")
106
+
107
+ version_set_urn = old_entity_version.versionSet
108
+ self.link_asset_to_version_set(
109
+ new_asset_urn, version_set_urn, label, comment=comment
110
+ )
111
+ return version_set_urn
112
+
113
+ def unlink_asset_from_version_set(self, asset_urn: str) -> Optional[str]:
114
+ """Unlinks an entity from its version set.
115
+
116
+ Args:
117
+ asset_urn: URN of the entity to unlink from its version set.
118
+
119
+ Returns:
120
+ If successful, the URN of the version set from which `asset_urn` was unlinked.
121
+ """
122
+
123
+ entity_version = self.get_aspect(asset_urn, VersionPropertiesClass)
124
+ if not entity_version:
125
+ raise ValueError(f"Asset {asset_urn} is not versioned")
126
+
127
+ variables = {
128
+ "input": {
129
+ "versionSet": entity_version.versionSet,
130
+ "unlinkedEntity": asset_urn,
131
+ }
132
+ }
133
+ if self.execute_graphql(self.UNLINK_VERSION_MUTATION, variables):
134
+ return entity_version.versionSet
135
+ else:
136
+ return None
137
+
138
+ def unlink_latest_asset_from_version_set(
139
+ self, version_set_urn: str
140
+ ) -> Optional[str]:
141
+ """Unlinks the latest version of a version set.
142
+
143
+ Args:
144
+ version_set_urn: URN of the version set.
145
+
146
+ Returns:
147
+ If successful, the URN of the entity that was unlinked from `version_set_urn`.
148
+ """
149
+
150
+ version_set_properties = self.get_aspect(
151
+ version_set_urn, VersionSetPropertiesClass
152
+ )
153
+ if not version_set_properties:
154
+ raise ValueError(
155
+ f"Version set {version_set_urn} does not exist or has no versions"
156
+ )
157
+
158
+ variables = {
159
+ "input": {
160
+ "versionSet": version_set_urn,
161
+ "unlinkedEntity": version_set_properties.latest,
162
+ }
163
+ }
164
+ if self.execute_graphql(self.UNLINK_VERSION_MUTATION, variables):
165
+ return version_set_properties.latest
166
+ else:
167
+ return None
@@ -0,0 +1,267 @@
1
+ import logging
2
+ import time
3
+ from dataclasses import dataclass
4
+ from typing import Any, Dict, Iterable, List, Optional, Tuple
5
+
6
+ from pydantic import BaseModel
7
+ from tenacity import (
8
+ retry,
9
+ retry_if_exception_type,
10
+ stop_after_attempt,
11
+ wait_exponential,
12
+ )
13
+
14
+ from acryl_datahub_cloud.datahub_metadata_sharing.query import (
15
+ GRAPHQL_SCROLL_SHARED_ENTITIES,
16
+ GRAPHQL_SHARE_ENTITY,
17
+ )
18
+ from datahub.ingestion.api.common import PipelineContext
19
+ from datahub.ingestion.api.decorators import (
20
+ SupportStatus,
21
+ config_class,
22
+ platform_name,
23
+ support_status,
24
+ )
25
+ from datahub.ingestion.api.source import Source, SourceReport
26
+ from datahub.ingestion.api.workunit import MetadataWorkUnit
27
+ from datahub.ingestion.graph.client import DataHubGraph
28
+
29
+ logger = logging.getLogger(__name__)
30
+
31
+
32
+ class GraphQLError(Exception):
33
+ """Custom exception for GraphQL-specific errors"""
34
+
35
+ pass
36
+
37
+
38
+ class DataHubMetadataSharingSourceConfig(BaseModel):
39
+ batch_size: int = 100
40
+ batch_delay_ms: int = 100
41
+ max_retries: int = 3
42
+ initial_retry_delay_ms: int = 1000
43
+
44
+
45
+ @dataclass
46
+ class DataHubMetadataSharingSourceReport(SourceReport):
47
+ entities_shared: int = 0
48
+ entities_failed: int = 0
49
+ implicit_entities_skipped: int = 0
50
+ batches_processed: int = 0
51
+
52
+
53
+ @platform_name(id="datahub", platform_name="DataHub")
54
+ @config_class(DataHubMetadataSharingSourceConfig)
55
+ @support_status(SupportStatus.INCUBATING)
56
+ class DataHubMetadataSharingSource(Source):
57
+ """MetadataSharing Source that reshares entities across DataHub instances"""
58
+
59
+ def __init__(
60
+ self, config: DataHubMetadataSharingSourceConfig, ctx: PipelineContext
61
+ ):
62
+ super().__init__(ctx)
63
+ self.config: DataHubMetadataSharingSourceConfig = config
64
+ self.report = DataHubMetadataSharingSourceReport()
65
+ self.graph: Optional[DataHubGraph] = None
66
+
67
+ @retry(
68
+ retry=retry_if_exception_type((GraphQLError, ConnectionError)),
69
+ stop=stop_after_attempt(3),
70
+ wait=wait_exponential(multiplier=1, min=4, max=10),
71
+ reraise=True,
72
+ )
73
+ def execute_graphql_with_retry(
74
+ self, query: str, variables: Dict[str, Any]
75
+ ) -> Dict[str, Any]:
76
+ """Execute GraphQL query with retry logic"""
77
+ if self.graph is None:
78
+ raise ValueError("Graph client not initialized")
79
+ response = self.graph.execute_graphql(query, variables=variables)
80
+ error = response.get("error")
81
+ if error:
82
+ raise GraphQLError(f"GraphQL error: {error}")
83
+ return response
84
+
85
+ def get_workunits(self) -> Iterable[MetadataWorkUnit]:
86
+ self.graph = self.ctx.require_graph("Loading default graph coordinates.")
87
+
88
+ self.reshare_entities()
89
+
90
+ # This source doesn't produce any work units
91
+ return []
92
+
93
+ def reshare_entities(self) -> None:
94
+ scroll_id: Optional[str] = None
95
+ current_batch_number: int = 1
96
+
97
+ try:
98
+ while True:
99
+ next_scroll_id, results = self.scroll_shared_entities(
100
+ scroll_id, self.config.batch_size
101
+ )
102
+
103
+ for result in results:
104
+ self._process_single_entity(result)
105
+
106
+ self.report.batches_processed = current_batch_number
107
+ self.report.info(
108
+ message="Completed sharing batch of entities.",
109
+ context=f"{current_batch_number} of size {self.config.batch_size}!",
110
+ )
111
+ current_batch_number += 1
112
+
113
+ if next_scroll_id is None:
114
+ break
115
+ else:
116
+ scroll_id = next_scroll_id
117
+
118
+ time.sleep(self.config.batch_delay_ms / 1000.0)
119
+
120
+ except Exception as e:
121
+ self.report.report_failure(
122
+ title="Failed to process batches",
123
+ message="Error occurred while processing one or more batches!",
124
+ context=f"message = {str(e)}",
125
+ exc=e,
126
+ )
127
+ return
128
+
129
+ self.report.info(
130
+ message="Completed sharing all entities.",
131
+ context=f"Successfully shared {self.report.entities_shared} entities, "
132
+ f"failed to share {self.report.entities_failed} entities.",
133
+ )
134
+
135
+ # Rest of the methods remain the same...
136
+
137
+ def _process_single_entity(self, result: Dict[str, Any]) -> None:
138
+ """Process a single entity result"""
139
+ entity_urn = result.get("entity", {}).get("urn", None)
140
+ share_results = (
141
+ result.get("entity", {}).get("share", {}).get("lastShareResults", [])
142
+ )
143
+
144
+ if entity_urn is None:
145
+ self.report.report_warning(
146
+ message="Failed to resolve entity urn for shared asset! Skipping...",
147
+ context=f"Response: {str(result)}",
148
+ )
149
+ return
150
+
151
+ for share_result in share_results:
152
+ try:
153
+ destination_data = share_result.get("destination", {})
154
+ destination_urn = destination_data.get("urn", "")
155
+ previous_status = share_result.get("status")
156
+ share_config = share_result.get("shareConfig", {})
157
+
158
+ # Important: If there is implicit entity, we should skip this urn.
159
+ # This means the entity was not EXPLICITLY shared, so we do not want to explicitly share here.
160
+ implicit_shared_entity = share_result.get("implicitShareEntity")
161
+ is_implicitly_shared = (
162
+ implicit_shared_entity is not None
163
+ and "urn" in implicit_shared_entity
164
+ )
165
+
166
+ if is_implicitly_shared:
167
+ self.report.implicit_entities_skipped += 1
168
+ continue
169
+
170
+ if previous_status != "SUCCESS":
171
+ self.report.report_warning(
172
+ message="Attempting to share a previously unsuccessful shared entity!",
173
+ context=f"entity urn: {entity_urn}, destination urn: {destination_urn}",
174
+ )
175
+
176
+ lineage_direction = self._determine_lineage_direction(share_config)
177
+
178
+ shared = self.share_entity(
179
+ entity_urn=entity_urn,
180
+ destination_urn=destination_urn,
181
+ lineage_direction=lineage_direction,
182
+ )
183
+
184
+ if shared:
185
+ self.report.entities_shared += 1
186
+ else:
187
+ self.report.entities_failed += 1
188
+
189
+ except Exception as e:
190
+ self.report.report_warning(
191
+ message="Failed to share single entity!",
192
+ context=f"entity urn: {entity_urn}",
193
+ )
194
+ logger.exception(f"Error processing entity {entity_urn}", e)
195
+ self.report.entities_failed += 1
196
+
197
+ def _determine_lineage_direction(
198
+ self, share_config: Optional[Dict[str, Any]]
199
+ ) -> Optional[str]:
200
+ if share_config is None:
201
+ return None
202
+
203
+ """Determine lineage direction based on share config"""
204
+ include_upstreams = share_config.get("enableUpstreamLineage", False)
205
+ include_downstreams = share_config.get(
206
+ "enableDownstreamLineage", False
207
+ ) # Fixed typo
208
+
209
+ if include_upstreams and include_downstreams:
210
+ return "BOTH"
211
+ if include_upstreams:
212
+ return "UPSTREAM"
213
+ if include_downstreams:
214
+ return "DOWNSTREAM"
215
+ return None
216
+
217
+ def scroll_shared_entities(
218
+ self, scroll_id: Optional[str], count: int
219
+ ) -> Tuple[Optional[str], List[Dict[str, Any]]]:
220
+ """Scroll through shared entities with retry logic"""
221
+ response = self.execute_graphql_with_retry(
222
+ GRAPHQL_SCROLL_SHARED_ENTITIES,
223
+ variables={
224
+ "scrollId": scroll_id,
225
+ "count": count,
226
+ },
227
+ )
228
+
229
+ result = response.get("scrollAcrossEntities", {})
230
+ return result.get("nextScrollId"), result.get("searchResults", [])
231
+
232
+ def share_entity(
233
+ self, entity_urn: str, destination_urn: str, lineage_direction: Optional[str]
234
+ ) -> bool:
235
+ """Share entity with retry logic"""
236
+ try:
237
+ response = self.execute_graphql_with_retry(
238
+ GRAPHQL_SHARE_ENTITY,
239
+ variables={
240
+ "entityUrn": entity_urn,
241
+ "destinationUrn": destination_urn,
242
+ "lineageDirection": lineage_direction,
243
+ },
244
+ )
245
+
246
+ result = response.get("shareEntity", {})
247
+ if not result.get("succeeded", False):
248
+ self.report.report_failure(
249
+ title="Failed to Share Entity",
250
+ message="Response returned that success failed for entity and destination!",
251
+ context=f"entity urn: {entity_urn}, destination urn: {destination_urn}",
252
+ )
253
+ return False
254
+
255
+ return True
256
+
257
+ except Exception as e:
258
+ self.report.report_failure(
259
+ title="Failed to Share Entity",
260
+ message="Exception occurred while sharing entity",
261
+ context=f"entity urn: {entity_urn}, destination urn: {destination_urn}",
262
+ exc=e,
263
+ )
264
+ return False
265
+
266
+ def get_report(self) -> SourceReport:
267
+ return self.report
@@ -0,0 +1,7 @@
1
+ import pathlib
2
+
3
+ GRAPHQL_SCROLL_SHARED_ENTITIES = (
4
+ pathlib.Path(__file__).parent / "scroll_shared_entities.gql"
5
+ ).read_text()
6
+
7
+ GRAPHQL_SHARE_ENTITY = (pathlib.Path(__file__).parent / "share_entity.gql").read_text()
@@ -0,0 +1,204 @@
1
+ fragment shareDetails on Share {
2
+ lastShareResults {
3
+ destination {
4
+ urn
5
+ }
6
+ implicitShareEntity {
7
+ urn
8
+ type
9
+ }
10
+ created {
11
+ time
12
+ actor {
13
+ urn
14
+ }
15
+ }
16
+ lastAttempt {
17
+ time
18
+ actor {
19
+ urn
20
+ }
21
+ }
22
+ lastSuccess {
23
+ time
24
+ actor {
25
+ urn
26
+ }
27
+ }
28
+ status
29
+ message
30
+ shareConfig {
31
+ enableUpstreamLineage
32
+ enableDownstreamLineage
33
+ }
34
+ statusLastUpdated
35
+ }
36
+ lastUnshareResults {
37
+ destination {
38
+ urn
39
+ }
40
+ implicitShareEntity {
41
+ urn
42
+ type
43
+ }
44
+ created {
45
+ time
46
+ actor {
47
+ urn
48
+ }
49
+ }
50
+ lastAttempt {
51
+ time
52
+ actor {
53
+ urn
54
+ }
55
+ }
56
+ lastSuccess {
57
+ time
58
+ actor {
59
+ urn
60
+ }
61
+ }
62
+ status
63
+ message
64
+ shareConfig {
65
+ enableUpstreamLineage
66
+ enableDownstreamLineage
67
+ }
68
+ statusLastUpdated
69
+ }
70
+ }
71
+
72
+
73
+ query scrollSharedEntities($scrollId: String, $count: Int!) {
74
+ scrollAcrossEntities(input: {
75
+ types: [],
76
+ query: "*",
77
+ scrollId: $scrollId,
78
+ count: $count,
79
+ orFilters: [
80
+ {
81
+ and: [
82
+ {
83
+ field: "shareDestinations",
84
+ condition: EXISTS,
85
+ values: []
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ }) {
91
+ nextScrollId
92
+ count
93
+ total
94
+ searchResults {
95
+ entity {
96
+ urn
97
+ type
98
+ ...on Dataset {
99
+ share {
100
+ ...shareDetails
101
+ }
102
+ }
103
+ ...on Container {
104
+ share {
105
+ ...shareDetails
106
+ }
107
+ }
108
+ ...on Dashboard {
109
+ share {
110
+ ...shareDetails
111
+ }
112
+ }
113
+ ...on Chart {
114
+ share {
115
+ ...shareDetails
116
+ }
117
+ }
118
+ ...on DataJob {
119
+ share {
120
+ ...shareDetails
121
+ }
122
+ }
123
+ ...on DataFlow {
124
+ share {
125
+ ...shareDetails
126
+ }
127
+ }
128
+ ...on MLModel {
129
+ share {
130
+ ...shareDetails
131
+ }
132
+ }
133
+ ...on MLModelGroup {
134
+ share {
135
+ ...shareDetails
136
+ }
137
+ }
138
+ ...on MLPrimaryKey {
139
+ share {
140
+ ...shareDetails
141
+ }
142
+ }
143
+ ...on MLFeature {
144
+ share {
145
+ ...shareDetails
146
+ }
147
+ }
148
+ ...on MLFeatureTable {
149
+ share {
150
+ ...shareDetails
151
+ }
152
+ }
153
+ ...on Domain {
154
+ share {
155
+ ...shareDetails
156
+ }
157
+ }
158
+ ...on DataProduct {
159
+ share {
160
+ ...shareDetails
161
+ }
162
+ }
163
+ ...on Tag {
164
+ share {
165
+ ...shareDetails
166
+ }
167
+ }
168
+ ...on CorpUser {
169
+ share {
170
+ ...shareDetails
171
+ }
172
+ }
173
+ ...on CorpGroup {
174
+ share {
175
+ ...shareDetails
176
+ }
177
+ }
178
+ ...on GlossaryTerm {
179
+ share {
180
+ ...shareDetails
181
+ }
182
+ }
183
+ ...on GlossaryNode {
184
+ share {
185
+ ...shareDetails
186
+ }
187
+ }
188
+ ...on Notebook {
189
+ share {
190
+ ...shareDetails
191
+ }
192
+ }
193
+ }
194
+ matchedFields {
195
+ name
196
+ value
197
+ }
198
+ insights {
199
+ text
200
+ icon
201
+ }
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,9 @@
1
+ mutation shareEntity($entityUrn: String!, $destinationUrn: String!, $lineageDirection: ShareLineageDirection) {
2
+ shareEntity(input: {
3
+ entityUrn: $entityUrn,
4
+ connectionUrn: $destinationUrn,
5
+ lineageDirection: $lineageDirection
6
+ }) {
7
+ succeeded
8
+ }
9
+ }
@@ -409,7 +409,6 @@ class DataHubBasedS3Dataset:
409
409
  physical_uri: str,
410
410
  local_file: str,
411
411
  ) -> Iterable[MetadataChangeProposalWrapper]:
412
-
413
412
  aspects: List = []
414
413
  mcps: List[MetadataChangeProposalWrapper] = self._update_presigned_url(
415
414
  dataset_urn, physical_uri
@@ -456,7 +455,6 @@ class DataHubBasedS3Dataset:
456
455
  physical_uri: str,
457
456
  dataset_properties: Optional[DatasetPropertiesClass] = None,
458
457
  ) -> List[MetadataChangeProposalWrapper]:
459
-
460
458
  if self.config.generate_presigned_url:
461
459
  external_url = self._generate_presigned_url(physical_uri)
462
460
  else: