cmem-plugin-validation 1.3.3rc1__tar.gz → 1.3.3rc2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmem-plugin-validation
3
- Version: 1.3.3rc1
3
+ Version: 1.3.3rc2
4
4
  Summary: Validate graph and data structures.
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -14,6 +14,7 @@ class State:
14
14
  total: int
15
15
  with_violations: int
16
16
  violations: int
17
+ error: str | None
17
18
 
18
19
  def __init__(self, client: Client, id_: str):
19
20
  self.client = client
@@ -29,3 +30,4 @@ class State:
29
30
  self.total = aggregation.resource_count
30
31
  self.with_violations = aggregation.resources_with_violations_count
31
32
  self.violations = aggregation.violations_count
33
+ self.error = aggregation.error
@@ -6,7 +6,12 @@ from time import sleep
6
6
 
7
7
  from cmem_client.client import Client
8
8
  from cmem_client.models.query_catalog import Query
9
- from cmem_client.models.validation import STATUS_RUNNING, STATUS_SCHEDULED, ValidationViolation
9
+ from cmem_client.models.validation import (
10
+ STATUS_FINISHED,
11
+ STATUS_RUNNING,
12
+ STATUS_SCHEDULED,
13
+ ValidationViolation,
14
+ )
10
15
  from cmem_plugin_base.dataintegration.context import ExecutionContext, ExecutionReport
11
16
  from cmem_plugin_base.dataintegration.description import Icon, Plugin, PluginParameter
12
17
  from cmem_plugin_base.dataintegration.entity import (
@@ -229,6 +234,17 @@ class ValidateGraph(WorkflowPlugin):
229
234
  continue
230
235
  # when reported as finished, error or cancelled break out
231
236
  break
237
+ if state.status != STATUS_FINISHED:
238
+ failure = state.error or f"Validation process ended in state {state.status}."
239
+ context.report.update(
240
+ ExecutionReport(
241
+ entity_count=state.completed,
242
+ operation="read",
243
+ operation_desc=f"/ {state.total} Resources validated",
244
+ error=failure,
245
+ )
246
+ )
247
+ raise RuntimeError(failure)
232
248
  summary: list[tuple[str, str]] = [
233
249
  (data_key, str(state.data[data_key])) for data_key in state.data
234
250
  ]
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cmem-plugin-validation"
3
- version = "1.3.3rc1"
3
+ version = "1.3.3rc2"
4
4
  license = "Apache-2.0"
5
5
  description = "Validate graph and data structures."
6
6
  authors = ["eccenca GmbH <cmempy-developer@eccenca.com>"]