datamasque-python 1.1.1__py3-none-any.whl → 1.1.2__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.
- datamasque/client/discovery.py +6 -2
- datamasque/client/models/status.py +14 -1
- {datamasque_python-1.1.1.dist-info → datamasque_python-1.1.2.dist-info}/METADATA +1 -1
- {datamasque_python-1.1.1.dist-info → datamasque_python-1.1.2.dist-info}/RECORD +6 -6
- {datamasque_python-1.1.1.dist-info → datamasque_python-1.1.2.dist-info}/WHEEL +0 -0
- {datamasque_python-1.1.1.dist-info → datamasque_python-1.1.2.dist-info}/licenses/LICENSE +0 -0
datamasque/client/discovery.py
CHANGED
|
@@ -166,7 +166,7 @@ class DiscoveryClient(BaseClient):
|
|
|
166
166
|
returns a list containing one ruleset
|
|
167
167
|
|
|
168
168
|
Raises `AsyncRulesetGenerationInProgressError` if the task hasn't finished yet,
|
|
169
|
-
and `DataMasqueException` if it failed.
|
|
169
|
+
and `DataMasqueException` if it failed or was cancelled.
|
|
170
170
|
|
|
171
171
|
Note that the ruleset(s) have autogenerated names, which you may want to customize before uploading.
|
|
172
172
|
"""
|
|
@@ -176,7 +176,11 @@ class DiscoveryClient(BaseClient):
|
|
|
176
176
|
logger.error("Ruleset generation failed for connection: %s", connection_id)
|
|
177
177
|
raise DataMasqueException(f"Ruleset generation failed for connection: {connection_id}")
|
|
178
178
|
|
|
179
|
-
if status is
|
|
179
|
+
if status is AsyncRulesetGenerationTaskStatus.cancelled:
|
|
180
|
+
logger.error("Ruleset generation was cancelled for connection: %s", connection_id)
|
|
181
|
+
raise DataMasqueException(f"Ruleset generation was cancelled for connection: {connection_id}")
|
|
182
|
+
|
|
183
|
+
if not status.is_finished:
|
|
180
184
|
logger.error(
|
|
181
185
|
"Ruleset generation is still in progress for connection: %s. Status: `%s`",
|
|
182
186
|
connection_id,
|
|
@@ -64,15 +64,28 @@ class AsyncRulesetGenerationTaskStatus(enum.Enum):
|
|
|
64
64
|
failed = "failed"
|
|
65
65
|
running = "running"
|
|
66
66
|
queued = "queued"
|
|
67
|
+
cancelled = "cancelled"
|
|
67
68
|
|
|
68
69
|
@classmethod
|
|
69
70
|
def get_final_states(cls) -> set["AsyncRulesetGenerationTaskStatus"]:
|
|
70
71
|
"""Returns the list of final statuses, i.e. the ruleset generation has completed, successfully or otherwise."""
|
|
71
72
|
|
|
72
|
-
return {cls.finished, cls.failed}
|
|
73
|
+
return {cls.finished, cls.finished_with_warnings, cls.failed, cls.cancelled}
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def get_finished_states(cls) -> set["AsyncRulesetGenerationTaskStatus"]:
|
|
77
|
+
"""Returns the list of statuses that indicate the ruleset generation completed successfully."""
|
|
78
|
+
|
|
79
|
+
return {cls.finished, cls.finished_with_warnings}
|
|
73
80
|
|
|
74
81
|
@property
|
|
75
82
|
def is_in_final_state(self) -> bool:
|
|
76
83
|
"""Returns True if this status is a final status."""
|
|
77
84
|
|
|
78
85
|
return self in self.get_final_states()
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def is_finished(self) -> bool:
|
|
89
|
+
"""Returns True if this status is a finished status."""
|
|
90
|
+
|
|
91
|
+
return self in self.get_finished_states()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datamasque-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Official Python client for the DataMasque data-masking API.
|
|
5
5
|
Project-URL: Homepage, https://datamasque.com/
|
|
6
6
|
Project-URL: Documentation, https://datamasque-python.readthedocs.io/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
datamasque/client/__init__.py,sha256=GmpVFNWZPu6jyadhY6SOZp4hLR1wUc4cgzwLcqoEA5o,6312
|
|
2
2
|
datamasque/client/base.py,sha256=vP1LuYbqq6U8NAEJWnwNrdt_Fa2wjQTJXHf0gSFO79c,14115
|
|
3
3
|
datamasque/client/connections.py,sha256=EFinx8fJRme0mTxuWY3d29UnmUFbsQhMaUQT0Ma2PK4,2885
|
|
4
|
-
datamasque/client/discovery.py,sha256=
|
|
4
|
+
datamasque/client/discovery.py,sha256=MTDiif6YWkv64hHXZ8YJxtRhoeKIvQVfjNYvjCIZCXE,21261
|
|
5
5
|
datamasque/client/discovery_configs.py,sha256=G-W-X_KizjjQLa-Rb6ixLjlkxbkCe4WGCOfYZrGtxIk,6420
|
|
6
6
|
datamasque/client/dmclient.py,sha256=tA7V8GEQmnsalTHUZch8YmIUynYw2ldK-mmUGbofFL4,1650
|
|
7
7
|
datamasque/client/exceptions.py,sha256=Tx7tE6i1X_oemR3EOJC97_sihZiToHqGuOQmWWxs_BE,3131
|
|
@@ -28,9 +28,9 @@ datamasque/client/models/pagination.py,sha256=egg9aO2cf6KUDwDANPu5RxpJbdRKdwUdCQ
|
|
|
28
28
|
datamasque/client/models/ruleset.py,sha256=ZYv6SmcrONV5rLK0tKjhlKCwZiCU1dMYtH7olxI4l5A,1678
|
|
29
29
|
datamasque/client/models/ruleset_library.py,sha256=5UbL_M47mgPedo8xt4q5crUh4aeOVoEMAEKbGO8CfiY,950
|
|
30
30
|
datamasque/client/models/runs.py,sha256=UtPMGCJFLFP1f2nyVGAbl3A5_wAONrRNJ63y43Hbpi0,6213
|
|
31
|
-
datamasque/client/models/status.py,sha256=
|
|
31
|
+
datamasque/client/models/status.py,sha256=UUEDHd3CQZA1Mf-1LyhAiE4COuCWvAz5oJx5ECVIwp4,2868
|
|
32
32
|
datamasque/client/models/user.py,sha256=UGAUzgJkf78m24_zFXXoA99zdut48BXkX_ivV8yq1Vc,2043
|
|
33
|
-
datamasque_python-1.1.
|
|
34
|
-
datamasque_python-1.1.
|
|
35
|
-
datamasque_python-1.1.
|
|
36
|
-
datamasque_python-1.1.
|
|
33
|
+
datamasque_python-1.1.2.dist-info/METADATA,sha256=0S1FrNnn9ZEVX8or5A2WcTz3t-ewccuy9O7jx2vY1TY,4187
|
|
34
|
+
datamasque_python-1.1.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
35
|
+
datamasque_python-1.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
36
|
+
datamasque_python-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|