Skip to content

Commit d85ba66

Browse files
Merge pull request #21 from datamasque/epic/discovery-config
Add support for discovery configurations
2 parents 4c93889 + d0c59d5 commit d85ba66

27 files changed

Lines changed: 2251 additions & 120 deletions

.github/workflows/release-testpypi.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@ name: Release (TestPyPI)
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'Branch, tag, or commit SHA to build from'
8+
required: true
9+
default: 'main'
10+
dev_version:
11+
description: >-
12+
Optional PEP 440 pre/dev version override (e.g. 1.1.0.dev1, 1.1.0a2, 1.1.0rc1).
13+
Leave blank to use the version in pyproject.toml as-is.
14+
required: false
15+
default: ''
516

617
jobs:
718
build:
819
name: Build sdist and wheel
920
runs-on: ubuntu-latest
1021
steps:
1122
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.ref }}
1225

1326
- name: Set up uv
1427
uses: astral-sh/setup-uv@v5
@@ -18,11 +31,37 @@ jobs:
1831
- name: Set up Python
1932
run: uv python install 3.12
2033

34+
- name: Apply dev_version override
35+
if: inputs.dev_version != ''
36+
# Pass the input through the environment, never interpolated into the script body:
37+
# `${{ }}` is expanded into the script text before the shell runs, so splicing it inline
38+
# would let a crafted dev_version inject shell commands before the validation below could reject it.
39+
env:
40+
DEV_VERSION: ${{ inputs.dev_version }}
41+
run: |
42+
# Reject anything that isn't a pre-release / dev version — final releases must go through release.yml.
43+
if ! printf '%s' "${DEV_VERSION}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(a|b|rc|\.dev)[0-9]+$'; then
44+
echo "::error::dev_version '${DEV_VERSION}' is not a PEP 440 pre/dev version (must end in aN, bN, rcN, or .devN)"
45+
exit 1
46+
fi
47+
uv run python -c "
48+
import os, re, pathlib
49+
version = os.environ['DEV_VERSION']
50+
path = pathlib.Path('pyproject.toml')
51+
text = path.read_text()
52+
new = re.sub(r'^version\s*=\s*\".*\"', f'version = \"{version}\"', text, count=1, flags=re.M)
53+
if new == text:
54+
raise SystemExit('Failed to locate version line in pyproject.toml')
55+
path.write_text(new)
56+
"
57+
2158
- name: Show package version
59+
env:
60+
REF: ${{ inputs.ref }}
2261
run: |
2362
VERSION="$(uv run python -c 'import tomllib; print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
24-
echo "Publishing version: ${VERSION}"
25-
echo "::notice title=TestPyPI version::${VERSION}"
63+
echo "Publishing version: ${VERSION} (from ref ${REF})"
64+
echo "::notice title=TestPyPI version::${VERSION} from ${REF}"
2665
2766
- name: Build
2867
run: uv build

HISTORY.rst

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

5+
1.1.0 (2026-06-24)
6+
------------------
7+
8+
* Added discovery configuration models and management APIs.
9+
* Added schema-discovery and file-data-discovery APIs that take a saved discovery configuration
10+
(``start_schema_discovery_run_from_config`` / ``start_file_data_discovery_run_from_config``).
11+
Adoption is recommended; the older APIs that take individual options will be deprecated in a future release.
12+
* Corrected the file-data-discovery ``include``/``skip`` filter syntax and added ``ignore_rules`` support.
13+
* Added ``InvalidDiscoveryConfigError`` and ``DiscoveryConfigNotFoundError``,
14+
raised when a discovery run can't start due to an unusable or missing discovery config.
15+
* Added ``get_discovery_run_config_snapshot_yaml`` to retrieve the discovery-config YAML
16+
that was effective at the start of a given discovery run.
17+
* Added ``is_user_subscribed`` to ``MaskingRunRequest`` to subscribe the requesting user to a run's email notifications.
18+
* Added ``auto_pull`` / ``auto_pull_branch`` to ``MaskingRunOptions``
19+
to refresh the run's ruleset from git before starting.
20+
* Added ``validation_error`` (and ``validation_error_type`` for rulesets) to ``Ruleset`` and ``RulesetLibrary``.
21+
* Exposed git provenance on ``Ruleset`` and ``RulesetLibrary`` as a nested ``git`` field (``GitSnapshot``).
22+
* Read-only fields (``id``, ``is_valid``, ``validation_error``, etc.)
23+
are no longer echoed back in ``Ruleset`` / ``RulesetLibrary`` create/update request bodies.
24+
* Fixed ``SslZipFile`` uploads to send the required ``database_type=mysql`` form field.
25+
* **Breaking:** ``delete_ruleset_by_name_if_exists`` now requires a ``ruleset_type`` argument,
26+
since ruleset names are unique only per type.
27+
528
1.0.5 (2026-06-18)
629
------------------
730

datamasque/client/__init__.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
DataMasqueNotReadyError,
1818
DataMasqueTransportError,
1919
DataMasqueUserError,
20+
DiscoveryConfigNotFoundError,
2021
FailedToStartError,
2122
IfmAuthError,
23+
InvalidDiscoveryConfigError,
2224
InvalidLibraryError,
2325
InvalidRulesetError,
2426
RunNotCancellableError,
@@ -54,22 +56,29 @@
5456
from datamasque.client.models.discovery import (
5557
ConstraintColumns,
5658
DiscoveryMatch,
59+
FileDataDiscoveryFromConfigRequest,
60+
FileDataDiscoveryOptions,
61+
FileDataDiscoveryRequest,
5762
FileDiscoveryFile,
5863
FileDiscoveryLocatorResult,
5964
FileDiscoveryMatch,
6065
FileDiscoveryResult,
66+
FileFilter,
67+
FileFilterMatchAgainst,
6168
FileRulesetGenerationRequest,
6269
ForeignKeyRef,
6370
InDataDiscoveryConfig,
6471
InDataDiscoveryRule,
6572
ReferencingForeignKey,
6673
RulesetGenerationRequest,
6774
SchemaDiscoveryColumn,
75+
SchemaDiscoveryFromConfigRequest,
6876
SchemaDiscoveryPage,
6977
SchemaDiscoveryRequest,
7078
SchemaDiscoveryResult,
7179
TableConstraints,
7280
)
81+
from datamasque.client.models.discovery_config import DiscoveryConfig, DiscoveryConfigId, DiscoveryConfigType
7382
from datamasque.client.models.dm_instance import DataMasqueInstanceConfig
7483
from datamasque.client.models.files import (
7584
DataMasqueFile,
@@ -79,6 +88,7 @@
7988
SnowflakeKeyFile,
8089
SslZipFile,
8190
)
91+
from datamasque.client.models.git import GitSnapshot
8292
from datamasque.client.models.ifm import (
8393
DataMasqueIfmInstanceConfig,
8494
IfmLog,
@@ -104,7 +114,12 @@
104114
RunInfo,
105115
UnfinishedRun,
106116
)
107-
from datamasque.client.models.status import AsyncRulesetGenerationTaskStatus, MaskingRunStatus, ValidationStatus
117+
from datamasque.client.models.status import (
118+
AsyncRulesetGenerationTaskStatus,
119+
MaskingRunStatus,
120+
ValidationErrorType,
121+
ValidationStatus,
122+
)
108123
from datamasque.client.models.user import User, UserId, UserRole
109124

110125
__version__ = version("datamasque-python")
@@ -130,18 +145,28 @@
130145
"DatabaseConnectionConfig",
131146
"DatabaseType",
132147
"DatabricksConnectionConfig",
148+
"DiscoveryConfig",
149+
"DiscoveryConfigId",
150+
"DiscoveryConfigNotFoundError",
151+
"DiscoveryConfigType",
133152
"DiscoveryMatch",
134153
"DynamoConnectionConfig",
135154
"FailedToStartError",
136155
"FileConnectionConfig",
156+
"FileDataDiscoveryFromConfigRequest",
157+
"FileDataDiscoveryOptions",
158+
"FileDataDiscoveryRequest",
137159
"FileDiscoveryFile",
138160
"FileDiscoveryLocatorResult",
139161
"FileDiscoveryMatch",
140162
"FileDiscoveryResult",
163+
"FileFilter",
164+
"FileFilterMatchAgainst",
141165
"FileId",
142166
"FileOrContent",
143167
"FileRulesetGenerationRequest",
144168
"ForeignKeyRef",
169+
"GitSnapshot",
145170
"HashColumnsTableConfig",
146171
"IfmAuthError",
147172
"IfmLog",
@@ -151,6 +176,7 @@
151176
"IfmTokenInfo",
152177
"InDataDiscoveryConfig",
153178
"InDataDiscoveryRule",
179+
"InvalidDiscoveryConfigError",
154180
"InvalidLibraryError",
155181
"InvalidRulesetError",
156182
"JsonPath",
@@ -182,6 +208,7 @@
182208
"RunNotCancellableError",
183209
"S3ConnectionConfig",
184210
"SchemaDiscoveryColumn",
211+
"SchemaDiscoveryFromConfigRequest",
185212
"SchemaDiscoveryPage",
186213
"SchemaDiscoveryRequest",
187214
"SchemaDiscoveryResult",
@@ -202,5 +229,6 @@
202229
"UserId",
203230
"UserRole",
204231
"UserSelection",
232+
"ValidationErrorType",
205233
"ValidationStatus",
206234
]

0 commit comments

Comments
 (0)