datamasque-python 1.0.1__tar.gz → 1.0.3__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.
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/HISTORY.rst +11 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/PKG-INFO +1 -1
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/__init__.py +2 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/connection.py +30 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/pyproject.toml +1 -1
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/setup.cfg +1 -1
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_connections.py +64 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/uv.lock +1 -1
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.editorconfig +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.github/workflows/ci.yml +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.github/workflows/release-testpypi.yml +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.github/workflows/release.yml +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.gitignore +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/.readthedocs.yaml +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/CONTRIBUTING.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/LICENSE +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/MANIFEST.in +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/Makefile +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/NOTICE +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/README.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/base.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/connections.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/discovery.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/dmclient.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/exceptions.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/files.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/ifm.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/license.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/__init__.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/data_selection.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/discovery.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/dm_instance.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/files.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/ifm.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/license.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/pagination.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/ruleset.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/ruleset_library.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/runs.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/status.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/user.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/py.typed +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/ruleset_libraries.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/rulesets.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/runs.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/settings.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/users.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/Makefile +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/client.models.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/client.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/conf.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/contributing.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/history.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/index.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/installation.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/make.bat +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/modules.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/readme.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/docs/usage.rst +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/__init__.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/conftest.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/helpers.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_base.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_discovery.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_files.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_ifm.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_license.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_pagination.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_ruleset_library.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_rulesets.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_runs.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_settings.py +0 -0
- {datamasque_python-1.0.1 → datamasque_python-1.0.3}/tests/test_users.py +0 -0
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
History
|
|
3
3
|
=======
|
|
4
4
|
|
|
5
|
+
1.0.3 (2026-05-27)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
* Added ``databricks`` to ``DatabaseType`` enum.
|
|
9
|
+
* Removed ``DatabricksDeltaS3ConnectionConfig``.
|
|
10
|
+
|
|
11
|
+
1.0.2 (2026-05-14)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
* Added ``DatabricksDeltaS3ConnectionConfig`` for Databricks Delta tables stored in S3.
|
|
15
|
+
|
|
5
16
|
1.0.1 (2026-05-11)
|
|
6
17
|
------------------
|
|
7
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datamasque-python
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
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/
|
|
@@ -30,6 +30,7 @@ from datamasque.client.models.connection import (
|
|
|
30
30
|
ConnectionId,
|
|
31
31
|
DatabaseConnectionConfig,
|
|
32
32
|
DatabaseType,
|
|
33
|
+
DatabricksConnectionConfig,
|
|
33
34
|
DynamoConnectionConfig,
|
|
34
35
|
FileConnectionConfig,
|
|
35
36
|
MongoConnectionConfig,
|
|
@@ -128,6 +129,7 @@ __all__ = [
|
|
|
128
129
|
"DataMasqueUserError",
|
|
129
130
|
"DatabaseConnectionConfig",
|
|
130
131
|
"DatabaseType",
|
|
132
|
+
"DatabricksConnectionConfig",
|
|
131
133
|
"DiscoveryMatch",
|
|
132
134
|
"DynamoConnectionConfig",
|
|
133
135
|
"FailedToStartError",
|
|
@@ -45,6 +45,7 @@ class DatabaseType(Enum):
|
|
|
45
45
|
snowflake = "snowflake"
|
|
46
46
|
mongodb = "mongodb"
|
|
47
47
|
databricks_lakebase = "databricks_lakebase"
|
|
48
|
+
databricks = "databricks"
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
class SnowflakeStageLocation(str, Enum):
|
|
@@ -280,6 +281,8 @@ class DatabaseConnectionConfig(ConnectionConfig):
|
|
|
280
281
|
raise ValueError("For Snowflake, use the SnowflakeConnectionConfig class instead")
|
|
281
282
|
if self.database_type is DatabaseType.mongodb:
|
|
282
283
|
raise ValueError("For MongoDB, use the MongoConnectionConfig class instead")
|
|
284
|
+
if self.database_type is DatabaseType.databricks:
|
|
285
|
+
raise ValueError("For Databricks SQL Warehouse, use the DatabricksConnectionConfig class instead")
|
|
283
286
|
return self
|
|
284
287
|
|
|
285
288
|
mask_type: Literal["database"] = "database"
|
|
@@ -391,6 +394,32 @@ class MountedShareConnectionConfig(FileConnectionConfig):
|
|
|
391
394
|
type: Literal["mounted_share_connection"] = "mounted_share_connection"
|
|
392
395
|
|
|
393
396
|
|
|
397
|
+
class DatabricksConnectionConfig(ConnectionConfig):
|
|
398
|
+
"""Connection configuration for a Databricks SQL Warehouse."""
|
|
399
|
+
|
|
400
|
+
server_hostname: str
|
|
401
|
+
http_path: str
|
|
402
|
+
access_token: Optional[str] = None
|
|
403
|
+
catalog: str
|
|
404
|
+
db_schema: Optional[str] = Field(default=None, alias="schema")
|
|
405
|
+
is_read_only: bool = False
|
|
406
|
+
version: str = "1.0"
|
|
407
|
+
|
|
408
|
+
mask_type: Literal["database"] = "database"
|
|
409
|
+
db_type: Literal["databricks"] = "databricks"
|
|
410
|
+
|
|
411
|
+
@property
|
|
412
|
+
def database_type(self) -> DatabaseType:
|
|
413
|
+
return DatabaseType.databricks
|
|
414
|
+
|
|
415
|
+
@model_validator(mode="before")
|
|
416
|
+
@classmethod
|
|
417
|
+
def _strip_encrypted_token(cls, data: dict) -> dict:
|
|
418
|
+
if isinstance(data, dict):
|
|
419
|
+
data.pop("access_token_encrypted", None)
|
|
420
|
+
return data
|
|
421
|
+
|
|
422
|
+
|
|
394
423
|
FILE_TYPE_MAP: dict[str, type[FileConnectionConfig]] = {
|
|
395
424
|
"s3_connection": S3ConnectionConfig,
|
|
396
425
|
"azure_blob_connection": AzureConnectionConfig,
|
|
@@ -402,6 +431,7 @@ DB_TYPE_MAP: dict[str, type[ConnectionConfig]] = {
|
|
|
402
431
|
DatabaseType.mongodb.value: MongoConnectionConfig,
|
|
403
432
|
DatabaseType.snowflake.value: SnowflakeConnectionConfig,
|
|
404
433
|
DatabaseType.mssql_linked.value: MssqlLinkedServerConnectionConfig,
|
|
434
|
+
DatabaseType.databricks.value: DatabricksConnectionConfig,
|
|
405
435
|
# others use the default `DatabaseConnectionConfig`
|
|
406
436
|
}
|
|
407
437
|
|
|
@@ -9,6 +9,7 @@ from datamasque.client.models.connection import (
|
|
|
9
9
|
ConnectionId,
|
|
10
10
|
DatabaseConnectionConfig,
|
|
11
11
|
DatabaseType,
|
|
12
|
+
DatabricksConnectionConfig,
|
|
12
13
|
DynamoConnectionConfig,
|
|
13
14
|
MongoConnectionConfig,
|
|
14
15
|
MountedShareConnectionConfig,
|
|
@@ -695,6 +696,69 @@ def test_s3_connection_model_validate_no_iam_role():
|
|
|
695
696
|
assert conn.iam_role_arn is None
|
|
696
697
|
|
|
697
698
|
|
|
699
|
+
def test_databricks_connection_model_validate():
|
|
700
|
+
payload = {
|
|
701
|
+
"id": "db-id-1",
|
|
702
|
+
"name": "databricks",
|
|
703
|
+
"mask_type": "database",
|
|
704
|
+
"db_type": "databricks",
|
|
705
|
+
"server_hostname": "adb-1234.azuredatabricks.net",
|
|
706
|
+
"http_path": "/sql/1.0/warehouses/abcd1234",
|
|
707
|
+
"access_token": "dapi1234",
|
|
708
|
+
"catalog": "main",
|
|
709
|
+
"schema": "default",
|
|
710
|
+
"is_read_only": False,
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
conn = DatabricksConnectionConfig.model_validate(payload)
|
|
714
|
+
|
|
715
|
+
assert isinstance(conn, DatabricksConnectionConfig)
|
|
716
|
+
assert conn.id == "db-id-1"
|
|
717
|
+
assert conn.server_hostname == "adb-1234.azuredatabricks.net"
|
|
718
|
+
assert conn.http_path == "/sql/1.0/warehouses/abcd1234"
|
|
719
|
+
assert conn.access_token == "dapi1234"
|
|
720
|
+
assert conn.catalog == "main"
|
|
721
|
+
assert conn.db_schema == "default"
|
|
722
|
+
assert conn.database_type is DatabaseType.databricks
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
def test_databricks_connection_model_validate_blanks_encrypted_token():
|
|
726
|
+
payload = {
|
|
727
|
+
"id": "db-id-2",
|
|
728
|
+
"name": "databricks",
|
|
729
|
+
"mask_type": "database",
|
|
730
|
+
"db_type": "databricks",
|
|
731
|
+
"server_hostname": "adb-1234.azuredatabricks.net",
|
|
732
|
+
"http_path": "/sql/1.0/warehouses/abcd1234",
|
|
733
|
+
"access_token_encrypted": "some_base64_here",
|
|
734
|
+
"catalog": "main",
|
|
735
|
+
"is_read_only": False,
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
conn = DatabricksConnectionConfig.model_validate(payload)
|
|
739
|
+
|
|
740
|
+
assert isinstance(conn, DatabricksConnectionConfig)
|
|
741
|
+
assert conn.access_token is None
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
def test_validate_connection_dispatches_databricks():
|
|
745
|
+
payload = {
|
|
746
|
+
"id": "db-id-3",
|
|
747
|
+
"name": "databricks",
|
|
748
|
+
"mask_type": "database",
|
|
749
|
+
"db_type": "databricks",
|
|
750
|
+
"server_hostname": "adb-1234.azuredatabricks.net",
|
|
751
|
+
"http_path": "/sql/1.0/warehouses/abcd1234",
|
|
752
|
+
"catalog": "main",
|
|
753
|
+
"is_read_only": False,
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
conn = validate_connection(payload)
|
|
757
|
+
|
|
758
|
+
assert isinstance(conn, DatabricksConnectionConfig)
|
|
759
|
+
assert conn.catalog == "main"
|
|
760
|
+
|
|
761
|
+
|
|
698
762
|
def test_azure_connection_model_validate_blanks_encrypted_connection_string():
|
|
699
763
|
payload = {
|
|
700
764
|
"id": "490502e5-5bf6-4abb-b67b-c6091d40ecf0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/data_selection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datamasque_python-1.0.1 → datamasque_python-1.0.3}/datamasque/client/models/ruleset_library.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|