feat: DM-3945 add table reference CRUD client APIs#40
Merged
Conversation
elliotsimpson-dm
previously requested changes
Jul 24, 2026
Wraps the new `/api/table-references/` endpoints from datamasque/datamasque!3534, mirroring the existing connection and discovery-config-library client patterns. - New `TableReferenceClient` mixin: list, get, get-by-name, create, update, create-or-update, delete by id/name. - New `TableReference`, `TableReferenceOptions` and `TableReferenceFormat` models. `connection` accepts a `ConnectionId` or a whole `ConnectionConfig`, as run requests do. - The list endpoint is unpaginated and shares the detail serializer, so a by-name lookup needs a single request; the endpoint takes no name filter, so the match is made client-side. - Deletes archive rather than remove, which frees the name for reuse. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Use `object` instead of `Any` in the new model validator and test annotations. - Fix docstring formatting for the schema.table reference. - Stop using `exclude_none=True` for request payloads: it silently dropped `options.null_string` (and any other nested `None`) instead of just omitting a wholly-unset `options`. Now only the `options` key itself is dropped when `None`, so explicit `None` values inside it (e.g. `null_string`) are still sent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Match discovery_configs.py's convention: a malformed server response (missing id) raises DataMasqueApiError with the triggering response attached, not the bare DataMasqueException, so callers catching DataMasqueApiError for API-shape problems catch this too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
elliotsimpson-dm
force-pushed
the
DM-3945-table-reference-api
branch
from
July 26, 2026 19:21
a02300c to
5e05400
Compare
elliotsimpson-dm
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Python client support for the
TableReferenceobject introduced by DM-3945 / datamasque/datamasque!3534.What
TableReferenceClientmixin over/api/table-references/:list_table_references,get_table_reference,get_table_reference_by_name,create_table_reference,update_table_reference,create_or_update_table_reference,delete_table_reference_by_id_if_exists,delete_table_reference_by_name_if_exists.TableReference,TableReferenceOptions,TableReferenceFormat(csv/parquet),TableReferenceId.connectionaccepts aConnectionIdor a wholeConnectionConfig(itsidis extracted), matchingMaskingRunRequest; aconnection_idproperty narrows the type back for reads.datamasque.client; mixed intoDataMasqueClient;HISTORY.rstentry and version bump to1.1.8.Notes on matching the server
get_table_reference_by_nameneeds one request rather than two. There is noname_exactfilter server-side, so the name match is made client-side over the full listing.create_or_update_table_referencekeys on the name.optionsare omitted from the request entirely when unset (the server keeps what it has stored) and replaced wholesale when set. They are sent regardless of the connection's type, mirroring the server, which accepts and stores them for database connections too.sourceis not validated client-side. Its meaning is discriminated by the connection's own type (file path vs. dottedschema.table), and the file format is the explicitoptions.formatchoice rather than being inferred from the path's suffix.Testing
21 new tests; full suite (421) green.
make lintclean (ruff, ruff format, mypy).🤖 Generated with Claude Code