Repository navigation
Conversation
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsOpt-in dbt ingestion patches existing schema metadata, so source declarations may alter catalog ownership, certification, tags, and custom properties. Adds an ✅ 1 closed✅ Bug: Case-insensitive table binding is rejected and reported as a failure
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Describe your changes
Fixes #38832
dbt keeps metadata declared on a source in
source_meta. We already use the table-level metadata, but the physical DatabaseSchema still has to be updated by hand. This adds anincludeSchemaMetadataoption so teams can keep those schema values in dbt. The default is off for saved workflows.Type of change
High-level design
The dbt source groups eligible declarations by the UUID of an existing schema, then writes one conditional patch per schema. It uses a uniquely resolved source table's schema when available and otherwise tries an exact schema name in the configured service. Direct owners and domains are kept, glossary terms are additive, and custom properties are updated only for the keys declared in dbt. Conflicting declarations leave the affected field alone and identify the source IDs in ingestion status.
On a version conflict, the worker fetches the schema again and rebuilds the patch. A repeat run with the same declarations keeps the certification dates and schema version. If the bot cannot read the configured certification classification, a fully qualified certification label can still be validated by the server.
Tests
schema_metadata.pyreached 90.12% line coverage.make generate, model freshness, the Python lock, Python formatting, and UI schema parsing passed. Scoped Python type checks found no errors. The full locked type check stopped at a package download.DatabaseSchemaResourceIT#conditionalIngestionPatchPreservesServerCertificationDates. The normal ingestion bot made the conditional PATCH, a stale request returned412, and an identical replay preserved the stored version and certification dates.0, andCertification.Gold. All three table models were stored. The second made zero schema PATCHes and preserved the full schema snapshot, including the version and certification timestamps.To try it, enable
includeSchemaMetadataon a dbt workflow with a source mapped to an existing schema. Run it with one source-level declaration, check the schema fields, then run the same artifact again and compare the version and certification expiry.UI screen recording
The existing schema-driven dbt form renders the new option. The Docker recording is pending.
Checklist
REVIEW.md.The write policy is open for feedback on the issue. Could a maintainer also add the issue to Shipping?