datamasque-python 1.1.6__py3-none-any.whl → 1.1.7__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/__init__.py +2 -0
- datamasque/client/models/connection.py +3 -0
- datamasque/client/models/ruleset.py +3 -5
- datamasque/client/models/ruleset_library.py +3 -3
- datamasque/client/models/status.py +13 -1
- datamasque/client/ruleset_libraries.py +3 -3
- datamasque/client/rulesets.py +2 -3
- {datamasque_python-1.1.6.dist-info → datamasque_python-1.1.7.dist-info}/METADATA +1 -1
- {datamasque_python-1.1.6.dist-info → datamasque_python-1.1.7.dist-info}/RECORD +11 -11
- {datamasque_python-1.1.6.dist-info → datamasque_python-1.1.7.dist-info}/WHEEL +0 -0
- {datamasque_python-1.1.6.dist-info → datamasque_python-1.1.7.dist-info}/licenses/LICENSE +0 -0
datamasque/client/__init__.py
CHANGED
|
@@ -119,6 +119,7 @@ from datamasque.client.models.runs import (
|
|
|
119
119
|
from datamasque.client.models.status import (
|
|
120
120
|
AsyncRulesetGenerationTaskStatus,
|
|
121
121
|
MaskingRunStatus,
|
|
122
|
+
ValidationErrorDetails,
|
|
122
123
|
ValidationErrorType,
|
|
123
124
|
ValidationStatus,
|
|
124
125
|
)
|
|
@@ -234,6 +235,7 @@ __all__ = [
|
|
|
234
235
|
"UserId",
|
|
235
236
|
"UserRole",
|
|
236
237
|
"UserSelection",
|
|
238
|
+
"ValidationErrorDetails",
|
|
237
239
|
"ValidationErrorType",
|
|
238
240
|
"ValidationStatus",
|
|
239
241
|
]
|
|
@@ -166,6 +166,7 @@ class MongoConnectionConfig(ConnectionConfig):
|
|
|
166
166
|
tls_ca_file: str = ""
|
|
167
167
|
tls_allow_invalid_certificates: bool = False
|
|
168
168
|
direct_connection: bool = False
|
|
169
|
+
retry_writes: bool = True
|
|
169
170
|
replica_set: str = ""
|
|
170
171
|
is_read_only: bool = False
|
|
171
172
|
|
|
@@ -194,6 +195,8 @@ class MongoConnectionConfig(ConnectionConfig):
|
|
|
194
195
|
d.pop("tls_allow_invalid_certificates", None)
|
|
195
196
|
if not d.get("direct_connection"):
|
|
196
197
|
d.pop("direct_connection", None)
|
|
198
|
+
if d.get("retry_writes", True):
|
|
199
|
+
d.pop("retry_writes", None)
|
|
197
200
|
if not d.get("replica_set"):
|
|
198
201
|
d.pop("replica_set", None)
|
|
199
202
|
if not d.get("user"):
|
|
@@ -4,7 +4,7 @@ from typing import Any, NewType, Optional
|
|
|
4
4
|
from pydantic import Field
|
|
5
5
|
|
|
6
6
|
from datamasque.client.models.git import GitTrackedEntity
|
|
7
|
-
from datamasque.client.models.status import
|
|
7
|
+
from datamasque.client.models.status import ValidationErrorDetails, ValidationStatus
|
|
8
8
|
|
|
9
9
|
RulesetId = NewType("RulesetId", str)
|
|
10
10
|
|
|
@@ -44,7 +44,5 @@ class Ruleset(GitTrackedEntity):
|
|
|
44
44
|
# Server-populated read-only fields, excluded from request bodies.
|
|
45
45
|
id: Optional[RulesetId] = Field(default=None, exclude=True)
|
|
46
46
|
is_valid: Optional[ValidationStatus] = Field(default=None, exclude=True)
|
|
47
|
-
|
|
48
|
-
"""
|
|
49
|
-
validation_error_type: Optional[ValidationErrorType] = Field(default=None, exclude=True)
|
|
50
|
-
"""Category of the validation failure, or `None` when valid."""
|
|
47
|
+
validation_errors: list[ValidationErrorDetails] = Field(default_factory=list, exclude=True)
|
|
48
|
+
"""Validation errors surfaced by the server; empty when valid."""
|
|
@@ -4,7 +4,7 @@ from typing import NewType, Optional
|
|
|
4
4
|
from pydantic import Field
|
|
5
5
|
|
|
6
6
|
from datamasque.client.models.git import GitTrackedEntity
|
|
7
|
-
from datamasque.client.models.status import ValidationStatus
|
|
7
|
+
from datamasque.client.models.status import ValidationErrorDetails, ValidationStatus
|
|
8
8
|
|
|
9
9
|
RulesetLibraryId = NewType("RulesetLibraryId", str)
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ class RulesetLibrary(GitTrackedEntity):
|
|
|
19
19
|
# Server-populated read-only fields, excluded from request bodies.
|
|
20
20
|
id: Optional[RulesetLibraryId] = Field(default=None, exclude=True)
|
|
21
21
|
is_valid: Optional[ValidationStatus] = Field(default=None, exclude=True)
|
|
22
|
-
|
|
23
|
-
"""
|
|
22
|
+
validation_errors: list[ValidationErrorDetails] = Field(default_factory=list, exclude=True)
|
|
23
|
+
"""Validation errors surfaced by the server; empty when valid."""
|
|
24
24
|
created: Optional[datetime] = Field(default=None, exclude=True)
|
|
25
25
|
modified: Optional[datetime] = Field(default=None, exclude=True)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import enum
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from pydantic import BaseModel
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
class ValidationStatus(enum.Enum):
|
|
@@ -11,7 +14,7 @@ class ValidationStatus(enum.Enum):
|
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
class ValidationErrorType(enum.Enum):
|
|
14
|
-
"""Categorises why
|
|
17
|
+
"""Categorises why validation failed (see `ValidationErrorDetails.validation_error_type`)."""
|
|
15
18
|
|
|
16
19
|
ruleset = "ruleset"
|
|
17
20
|
library_missing = "library_missing"
|
|
@@ -19,6 +22,15 @@ class ValidationErrorType(enum.Enum):
|
|
|
19
22
|
expansion = "expansion" # The ruleset is not valid once its library references are expanded.
|
|
20
23
|
|
|
21
24
|
|
|
25
|
+
class ValidationErrorDetails(BaseModel):
|
|
26
|
+
"""A single validation error, with its position in the YAML when available."""
|
|
27
|
+
|
|
28
|
+
message: str
|
|
29
|
+
validation_error_type: Optional[ValidationErrorType] = None
|
|
30
|
+
line_number: Optional[int] = None
|
|
31
|
+
column_number: Optional[int] = None
|
|
32
|
+
|
|
33
|
+
|
|
22
34
|
class MaskingRunStatus(enum.Enum):
|
|
23
35
|
"""List of valid masking run statuses."""
|
|
24
36
|
|
|
@@ -64,7 +64,7 @@ class RulesetLibraryClient(BaseClient):
|
|
|
64
64
|
Creates a new ruleset library on the server.
|
|
65
65
|
|
|
66
66
|
Sets the library's server-assigned fields
|
|
67
|
-
(`id`, `is_valid`, `
|
|
67
|
+
(`id`, `is_valid`, `validation_errors`, `git`, `created`, `modified`) and returns the library.
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
70
|
data = library.model_dump(exclude_none=True, by_alias=True, mode="json")
|
|
@@ -72,7 +72,7 @@ class RulesetLibraryClient(BaseClient):
|
|
|
72
72
|
created_library = RulesetLibrary.model_validate(response.json())
|
|
73
73
|
library.id = created_library.id
|
|
74
74
|
library.is_valid = created_library.is_valid
|
|
75
|
-
library.
|
|
75
|
+
library.validation_errors = created_library.validation_errors
|
|
76
76
|
library.git = created_library.git
|
|
77
77
|
library.created = created_library.created
|
|
78
78
|
library.modified = created_library.modified
|
|
@@ -93,7 +93,7 @@ class RulesetLibraryClient(BaseClient):
|
|
|
93
93
|
response = self.make_request("PUT", f"/api/ruleset-libraries/{library.id}/", data=data)
|
|
94
94
|
updated_library = RulesetLibrary.model_validate(response.json())
|
|
95
95
|
library.is_valid = updated_library.is_valid
|
|
96
|
-
library.
|
|
96
|
+
library.validation_errors = updated_library.validation_errors
|
|
97
97
|
library.git = updated_library.git
|
|
98
98
|
library.modified = updated_library.modified
|
|
99
99
|
logger.debug('Update of ruleset library "%s" successful', library.name)
|
datamasque/client/rulesets.py
CHANGED
|
@@ -20,7 +20,7 @@ class RulesetClient(BaseClient):
|
|
|
20
20
|
"""
|
|
21
21
|
Creates or updates a ruleset.
|
|
22
22
|
|
|
23
|
-
Populates the given ruleset's `id`, `is_valid`, `
|
|
23
|
+
Populates the given ruleset's `id`, `is_valid`, `validation_errors`,
|
|
24
24
|
and `git` fields from the server response, and returns the same ruleset instance for convenience.
|
|
25
25
|
"""
|
|
26
26
|
|
|
@@ -29,8 +29,7 @@ class RulesetClient(BaseClient):
|
|
|
29
29
|
created = Ruleset.model_validate(response.json())
|
|
30
30
|
ruleset.id = created.id
|
|
31
31
|
ruleset.is_valid = created.is_valid
|
|
32
|
-
ruleset.
|
|
33
|
-
ruleset.validation_error_type = created.validation_error_type
|
|
32
|
+
ruleset.validation_errors = created.validation_errors
|
|
34
33
|
ruleset.git = created.git
|
|
35
34
|
|
|
36
35
|
if response.status_code == 201:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datamasque-python
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.7
|
|
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,4 +1,4 @@
|
|
|
1
|
-
datamasque/client/__init__.py,sha256=
|
|
1
|
+
datamasque/client/__init__.py,sha256=USBXQl-WIfbtfzXubPU_WX4hVP_jrETudUSBSgJU02w,6609
|
|
2
2
|
datamasque/client/base.py,sha256=cXU4dluL9e1N1F2pV48iIvebv6OHt7Kh4Ka2y9vkOPo,14296
|
|
3
3
|
datamasque/client/connections.py,sha256=EFinx8fJRme0mTxuWY3d29UnmUFbsQhMaUQT0Ma2PK4,2885
|
|
4
4
|
datamasque/client/discovery.py,sha256=MTDiif6YWkv64hHXZ8YJxtRhoeKIvQVfjNYvjCIZCXE,21261
|
|
@@ -10,14 +10,14 @@ datamasque/client/files.py,sha256=vc2tZgT8RdwuCObIQ7H-Qjb80H1PBFqD0nG5Y1tOA_o,35
|
|
|
10
10
|
datamasque/client/ifm.py,sha256=uIMxpLIPvDiDO1m4bxezixNIUFIFY0MXWRMQNvTbpTA,11858
|
|
11
11
|
datamasque/client/license.py,sha256=pluYaSU168OC6_laB9bM9H3Vuuxs8wa9gujCJvtoJCk,1392
|
|
12
12
|
datamasque/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
datamasque/client/ruleset_libraries.py,sha256=
|
|
14
|
-
datamasque/client/rulesets.py,sha256=
|
|
13
|
+
datamasque/client/ruleset_libraries.py,sha256=s--iZKB8EAC7bNYrU3ZI0olSWU-mXJoyUBOgJPfQ0xQ,7091
|
|
14
|
+
datamasque/client/rulesets.py,sha256=gzxn9mR7PhCySRUUB1cyl4aLmEfuDKj8BvQUq8OgLH8,2563
|
|
15
15
|
datamasque/client/runs.py,sha256=l_JpYgelqsDKW_O6LtsHC60IMXHG9ak_RwVnuvJKE1I,7703
|
|
16
16
|
datamasque/client/settings.py,sha256=Ui8AyR2XdoW8MZ9FIrGn2jm8DLzUGWIL8i2DOTvu7hc,2898
|
|
17
17
|
datamasque/client/spcs.py,sha256=geHrBQ6WLWsMGpSMV8hmK5SFAwftrOU0DXkrR2orOmo,7532
|
|
18
18
|
datamasque/client/users.py,sha256=VCUo2CJyOw4-aO_3mp_w_0BcSoa6-h1HcReMcAMyumw,3701
|
|
19
19
|
datamasque/client/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
datamasque/client/models/connection.py,sha256=
|
|
20
|
+
datamasque/client/models/connection.py,sha256=loLy4RCiIfY9kvBFspSqJSRhHqhcJxm_mQzXwMRS4VU,17529
|
|
21
21
|
datamasque/client/models/data_selection.py,sha256=406yyUZ5NmLBSql2lYM1gsTWY5GWmnutmF-DjznAoLc,1904
|
|
22
22
|
datamasque/client/models/discovery.py,sha256=WHSIkFebQ5m47K_BdxY1lvCeeF23q_BbZan7Ryuh5vY,13198
|
|
23
23
|
datamasque/client/models/discovery_config.py,sha256=1CHMgSxMXuarPGfRcz9wX7jeZLn1SDw0UEe-L5naE54,1917
|
|
@@ -28,12 +28,12 @@ datamasque/client/models/git.py,sha256=F0KdMFe2vMyL-9tp3SGKGeOlbD1gbcjQn0jpOzNzy
|
|
|
28
28
|
datamasque/client/models/ifm.py,sha256=j0Ef2BZYTk6MNZO6HS6mW0qWs1_wWD9PlUP_Y6WyBQI,5563
|
|
29
29
|
datamasque/client/models/license.py,sha256=OqIn4Sx3ATBStgt5KNiCOBChTTFYLBsyGj7inAl8oB4,2113
|
|
30
30
|
datamasque/client/models/pagination.py,sha256=egg9aO2cf6KUDwDANPu5RxpJbdRKdwUdCQAtusnuf1c,651
|
|
31
|
-
datamasque/client/models/ruleset.py,sha256=
|
|
32
|
-
datamasque/client/models/ruleset_library.py,sha256=
|
|
31
|
+
datamasque/client/models/ruleset.py,sha256=FDnvewJQvbeH73LpZiwYg3BG9Ya4yhmKKGmO1BKZQPk,1549
|
|
32
|
+
datamasque/client/models/ruleset_library.py,sha256=Pw6Udr7pMgPt1AcG2ZhUXOPBS7tTvpw13UZNLILhZbQ,1003
|
|
33
33
|
datamasque/client/models/runs.py,sha256=UtPMGCJFLFP1f2nyVGAbl3A5_wAONrRNJ63y43Hbpi0,6213
|
|
34
|
-
datamasque/client/models/status.py,sha256=
|
|
34
|
+
datamasque/client/models/status.py,sha256=WiSMEy_YxdcIA46ioYpAEu8OK8UNDoXpV1W7IUhhyVY,3219
|
|
35
35
|
datamasque/client/models/user.py,sha256=UGAUzgJkf78m24_zFXXoA99zdut48BXkX_ivV8yq1Vc,2043
|
|
36
|
-
datamasque_python-1.1.
|
|
37
|
-
datamasque_python-1.1.
|
|
38
|
-
datamasque_python-1.1.
|
|
39
|
-
datamasque_python-1.1.
|
|
36
|
+
datamasque_python-1.1.7.dist-info/METADATA,sha256=Z5CeCXlGF3L4GUl6-AITdcffk1EpDbJ1dcRqvfBbW5I,4497
|
|
37
|
+
datamasque_python-1.1.7.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
38
|
+
datamasque_python-1.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
39
|
+
datamasque_python-1.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|