Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
History
=======

1.7.0 (unreleased)
1.7.0 (2026-11-27)
------------------

* Added ``json_string_indexes`` to ``FileDiscoveryLocatorResult``:
the indexes into ``locator``, counted from 0, of the elements whose value is serialized JSON.
It is ``None`` when there are none, or when the server predates the field.
* Added an optional ``instance`` field to ``DatabaseConnectionConfig``: the SQL Server named instance,
taken from the Instance input in the connection form's advanced settings.
It round-trips through ``list_connections`` and ``create_or_update_connection``,
Expand Down
3 changes: 3 additions & 0 deletions datamasque/client/models/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ class FileDiscoveryLocatorResult(BaseModel):
data_types: list[str]
safe_data_preview: Optional[SafeDataPreview] = None
value_count: Optional[int] = None
# Indexes into `locator`, counted from 0, of the elements whose value is serialized JSON.
# None when there are none, or when the server predates the field.
json_string_indexes: Optional[list[int]] = None


class FileDiscoveryFile(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "datamasque-python"
version = "1.6.0"
version = "1.7.0"
description = "Official Python client for the DataMasque data-masking API."
authors = [
{ name = "DataMasque Ltd" },
Expand Down
26 changes: 26 additions & 0 deletions tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,32 @@ def test_file_discovery_value_counts_parse():
assert result.results[0].value_count == 30


def test_file_discovery_json_string_indexes_parse():
"""A locator through serialized JSON carries its string indexes; one from an older server has none."""

def locator_result(**extra: object) -> dict:
return {
"locator": ["*", "event_payload", "email"],
"data_types": ["str"],
"matches": [{"flagged_by": "MDD", "description": "Email", "label": "email"}],
**extra,
}

result = FileDiscoveryResult.model_validate(
{
"id": 10,
"connection": {"id": "conn-1", "name": "my files"},
"file_type": "json",
"files": [{"path": "data/events.json", "file_type": "json"}],
"results": [locator_result(json_string_indexes=[1]), locator_result()],
}
)

through_a_string, from_an_older_server = result.results
assert through_a_string.json_string_indexes == [1]
assert from_an_older_server.json_string_indexes is None


def test_file_discovery_uncounted_values_parse():
"""A file type that holds no values reports the reason, no counts, and a null count on the locator."""
result = FileDiscoveryResult.model_validate(
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading