acryl-datahub-cloud 0.3.12rc7__py3-none-any.whl → 0.3.12rc9__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.

@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acryl-datahub-cloud",
3
- "version": "0.3.12rc7",
3
+ "version": "0.3.12rc9",
4
4
  "install_requires": [
5
5
  "avro-gen3==0.7.16",
6
6
  "acryl-datahub"
@@ -119,10 +119,16 @@ class DataHubFormsNotificationsSource(Source):
119
119
  for urn, form in self.get_forms():
120
120
  if not self.is_form_complete(urn, form.type):
121
121
  assignees = self.get_form_assignees(urn, form)
122
- self.process_notify_on_publish(assignees, form.name, urn)
122
+ self.process_notify_on_publish(
123
+ assignees, form.name, urn, form.description
124
+ )
123
125
 
124
126
  def process_notify_on_publish(
125
- self, form_assignees: List[str], form_name: str, form_urn: str
127
+ self,
128
+ form_assignees: List[str],
129
+ form_name: str,
130
+ form_urn: str,
131
+ form_details: str | None,
126
132
  ) -> None:
127
133
  """
128
134
  Take in form assignees, find the ones who haven't been notified on publish, and build a notification for them.
@@ -139,12 +145,16 @@ class DataHubFormsNotificationsSource(Source):
139
145
  self.report.notifications_sent += recipient_count
140
146
  self.report.forms_count += 1
141
147
 
148
+ parameters = [{"key": "formName", "value": form_name}]
149
+ if form_details is not None:
150
+ parameters.append({"key": "formDetails", "value": form_details})
151
+
142
152
  response = self.execute_graphql_with_retry(
143
153
  GRAPHQL_SEND_FORM_NOTIFICATION_REQUEST,
144
154
  variables={
145
155
  "input": {
146
156
  "type": "BROADCAST_COMPLIANCE_FORM_PUBLISH",
147
- "parameters": [{"key": "formName", "value": form_name}],
157
+ "parameters": parameters,
148
158
  "recipients": self.recipient_builder.convert_recipients_to_json_objects(
149
159
  recipients
150
160
  ),
@@ -10,7 +10,7 @@ from pydantic import BaseModel
10
10
  from acryl_datahub_cloud.elasticsearch.graph_service import BaseModelRow
11
11
  from datahub.emitter.mcp import MetadataChangeProposalWrapper
12
12
  from datahub.ingestion.graph.client import DataHubGraph
13
- from datahub.ingestion.graph.filters import RawSearchFilterRule
13
+ from datahub.ingestion.graph.filters import RawSearchFilter
14
14
  from datahub.metadata.schema_classes import (
15
15
  DomainPropertiesClass,
16
16
  FormAssociationClass,
@@ -149,7 +149,7 @@ class DataHubFormReportingData(FormData):
149
149
  )
150
150
  )
151
151
 
152
- def get_form_existence_or_filters(self) -> List[RawSearchFilterRule]:
152
+ def get_form_existence_or_filters(self) -> RawSearchFilter:
153
153
  """
154
154
  Datasets must either have completedForms or incompleteForms assigned to
155
155
  them
@@ -157,25 +157,41 @@ class DataHubFormReportingData(FormData):
157
157
  if self.allowed_forms:
158
158
  return [
159
159
  {
160
- "field": "completedForms",
161
- "condition": "EQUAL",
162
- "values": self.allowed_forms,
160
+ "and": [
161
+ {
162
+ "field": "completedForms",
163
+ "condition": "EQUAL",
164
+ "values": self.allowed_forms,
165
+ }
166
+ ]
163
167
  },
164
168
  {
165
- "field": "incompleteForms",
166
- "condition": "EQUAL",
167
- "values": self.allowed_forms,
169
+ "and": [
170
+ {
171
+ "field": "incompleteForms",
172
+ "condition": "EQUAL",
173
+ "values": self.allowed_forms,
174
+ }
175
+ ]
168
176
  },
169
177
  ]
170
178
  else:
171
179
  return [
172
180
  {
173
- "field": "completedForms",
174
- "condition": "EXISTS",
181
+ "and": [
182
+ {
183
+ "field": "completedForms",
184
+ "condition": "EXISTS",
185
+ }
186
+ ]
175
187
  },
176
188
  {
177
- "field": "incompleteForms",
178
- "condition": "EXISTS",
189
+ "and": [
190
+ {
191
+ "field": "incompleteForms",
192
+ "condition": "EXISTS",
193
+ }
194
+ ]
179
195
  },
180
196
  ]
181
197
 
@@ -293,7 +309,7 @@ class DataHubFormReportingData(FormData):
293
309
  extra_fields = [f for f in self.DataHubDatasetSearchRow.__fields__]
294
310
  # TODO: Replace with the new search/filter SDK.
295
311
  result = self.graph.get_results_by_filter(
296
- extra_or_filters=[{"and": self.get_form_existence_or_filters()}],
312
+ extra_or_filters=self.get_form_existence_or_filters(),
297
313
  extra_source_fields=extra_fields,
298
314
  skip_cache=True,
299
315
  )