Skip to content

fix(contracts): accept ODCS v3.1.0 transformSourceObjects array#323

Open
SAY-5 wants to merge 1 commit into
databrickslabs:mainfrom
SAY-5:fix/odcs-transform-source-objects-list
Open

fix(contracts): accept ODCS v3.1.0 transformSourceObjects array#323
SAY-5 wants to merge 1 commit into
databrickslabs:mainfrom
SAY-5:fix/odcs-transform-source-objects-list

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 5, 2026

Fixes #285.

ColumnProperty.transformSourceObjects was typed as Optional[str], so ODCS v3.1.0-compliant uploads using the spec's array form (e.g. ["tbl_a"]) failed at POST /api/data-contracts with HTTP 422 ("Input should be a valid string") even though they passed the GitHub-workflow JSON-schema validation. Widening the type to Union[List[str], str] matches the ODCS v3.1.0 SchemaBaseProperty definition while keeping legacy string inputs valid; persistence (data_contracts_manager.py:1766) and export (:999) already handle both shapes.

@SAY-5 SAY-5 requested a review from a team as a code owner May 5, 2026 12:33
Copy link
Copy Markdown
Collaborator

@larsgeorge-db larsgeorge-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, ty!

@larsgeorge-db larsgeorge-db force-pushed the fix/odcs-transform-source-objects-list branch from e0727c8 to 32eb5b9 Compare May 21, 2026 20:38
@larsgeorge-db larsgeorge-db enabled auto-merge (rebase) May 21, 2026 20:38
ColumnProperty.transformSourceObjects was typed as Optional[str], so ODCS
v3.1.0-compliant uploads using the spec's array form (e.g. ["tbl_a"])
hit HTTP 422 at POST /api/data-contracts even though they passed the
JSON-schema validator. Widen the type to Union[List[str], str] so the
spec-compliant list form is accepted while existing string inputs remain
valid; persistence and export already handle both shapes. Fixes databrickslabs#285.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@larsgeorge-db larsgeorge-db force-pushed the fix/odcs-transform-source-objects-list branch from 7e847c9 to 51c9457 Compare May 22, 2026 19:58
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: ODCS Data Contract file upload to Ontos fails for schema validation error

3 participants