Skip to content

Commit 4f227ad

Browse files
committed
feat: Add DatabricksDeltaS3ConnectionConfig to configs
1 parent c626b50 commit 4f227ad

7 files changed

Lines changed: 79 additions & 3 deletions

File tree

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
History
33
=======
44

5+
1.0.2 (2026-05-14)
6+
------------------
7+
8+
* Added ``DatabricksDeltaS3ConnectionConfig`` for Databricks Delta tables stored in S3.
9+
510
1.0.1 (2026-05-11)
611
------------------
712

datamasque/client/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
ConnectionId,
3131
DatabaseConnectionConfig,
3232
DatabaseType,
33+
DatabricksDeltaS3ConnectionConfig,
3334
DynamoConnectionConfig,
3435
FileConnectionConfig,
3536
MongoConnectionConfig,
@@ -128,6 +129,7 @@
128129
"DataMasqueUserError",
129130
"DatabaseConnectionConfig",
130131
"DatabaseType",
132+
"DatabricksDeltaS3ConnectionConfig",
131133
"DiscoveryMatch",
132134
"DynamoConnectionConfig",
133135
"FailedToStartError",

datamasque/client/models/connection.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,19 @@ class MountedShareConnectionConfig(FileConnectionConfig):
391391
type: Literal["mounted_share_connection"] = "mounted_share_connection"
392392

393393

394+
class DatabricksDeltaS3ConnectionConfig(FileConnectionConfig):
395+
"""Connection configuration for Databricks Delta tables stored in S3."""
396+
397+
type: Literal["databricks_delta_s3_connection"] = "databricks_delta_s3_connection"
398+
bucket: str = ""
399+
iam_role_arn: Optional[str] = None
400+
401+
394402
FILE_TYPE_MAP: dict[str, type[FileConnectionConfig]] = {
395403
"s3_connection": S3ConnectionConfig,
396404
"azure_blob_connection": AzureConnectionConfig,
397405
"mounted_share_connection": MountedShareConnectionConfig,
406+
"databricks_delta_s3_connection": DatabricksDeltaS3ConnectionConfig,
398407
}
399408

400409
DB_TYPE_MAP: dict[str, type[ConnectionConfig]] = {

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "datamasque-python"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
description = "Official Python client for the DataMasque data-masking API."
55
authors = [
66
{ name = "DataMasque Ltd" },

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.1
2+
current_version = 1.0.2
33
commit = True
44
tag = True
55

tests/test_connections.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ConnectionId,
1010
DatabaseConnectionConfig,
1111
DatabaseType,
12+
DatabricksDeltaS3ConnectionConfig,
1213
DynamoConnectionConfig,
1314
MongoConnectionConfig,
1415
MountedShareConnectionConfig,
@@ -695,6 +696,65 @@ def test_s3_connection_model_validate_no_iam_role():
695696
assert conn.iam_role_arn is None
696697

697698

699+
def test_databricks_delta_s3_connection_model_validate():
700+
payload = {
701+
"id": "11223344-5566-7788-99aa-bbccddeeff00",
702+
"name": "delta_s3",
703+
"mask_type": "file",
704+
"type": "databricks_delta_s3_connection",
705+
"base_directory": "delta/",
706+
"is_file_mask_source": True,
707+
"is_file_mask_destination": False,
708+
"bucket": "my-delta-bucket",
709+
"iam_role_arn": "arn:aws:iam::111122223333:role/delta-role",
710+
}
711+
712+
conn = DatabricksDeltaS3ConnectionConfig.model_validate(payload)
713+
714+
assert isinstance(conn, DatabricksDeltaS3ConnectionConfig)
715+
assert conn.id == "11223344-5566-7788-99aa-bbccddeeff00"
716+
assert conn.name == "delta_s3"
717+
assert conn.bucket == "my-delta-bucket"
718+
assert conn.base_directory == "delta/"
719+
assert conn.is_file_mask_source is True
720+
assert conn.is_file_mask_destination is False
721+
assert conn.iam_role_arn == "arn:aws:iam::111122223333:role/delta-role"
722+
723+
724+
def test_databricks_delta_s3_connection_model_validate_no_iam_role():
725+
payload = {
726+
"id": "id-delta",
727+
"name": "delta_s3",
728+
"mask_type": "file",
729+
"type": "databricks_delta_s3_connection",
730+
"base_directory": "",
731+
"is_file_mask_source": True,
732+
"is_file_mask_destination": False,
733+
"bucket": "my-delta-bucket",
734+
}
735+
736+
conn = DatabricksDeltaS3ConnectionConfig.model_validate(payload)
737+
assert conn.iam_role_arn is None
738+
739+
740+
def test_validate_connection_dispatches_databricks_delta_s3():
741+
payload = {
742+
"id": "aabb-ccdd",
743+
"name": "delta",
744+
"mask_type": "file",
745+
"type": "databricks_delta_s3_connection",
746+
"base_directory": "",
747+
"is_file_mask_source": False,
748+
"is_file_mask_destination": True,
749+
"bucket": "delta-bucket",
750+
}
751+
752+
conn = validate_connection(payload)
753+
754+
assert isinstance(conn, DatabricksDeltaS3ConnectionConfig)
755+
assert conn.bucket == "delta-bucket"
756+
757+
698758
def test_azure_connection_model_validate_blanks_encrypted_connection_string():
699759
payload = {
700760
"id": "490502e5-5bf6-4abb-b67b-c6091d40ecf0",

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)