fix: honor features.operationalMetadataEnabled when creating target table schema - #149
Draft
binlogreader wants to merge 1 commit into
Conversation
…able schema (databricks-solutions#97) Operational metadata columns were appended to the target schema in BaseTargetDelta._initialize_schema, at construction time, before the per-spec features object exists. The read paths gate on features.operationalMetadataEnabled, so a spec disabling the feature produced a table whose schema carries metadata columns the written data never fills. Defer the augmentation into create_table, gated on features and defaulting to enabled when absent, and pass features at the two dataflow.py call sites that omitted it (streaming table and staging tables). _add_columns is name-idempotent, so SCD2 and quarantine columns added between construction and creation are unaffected. Quarantine tables are built without a schemaPath and never had the problem.
binlogreader
force-pushed
the
fix/issue-97-operational-metadata-schema-gating
branch
from
August 26, 2026 01:37
161fe8b to
4de70b0
Compare
1 task
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.
Fixes #97.
Operational metadata columns were appended to the target schema in
BaseTargetDelta._initialize_schema, at construction time, before the per-specfeaturesobject exists. The read paths gate onfeatures.operationalMetadataEnabled, so a spec disabling the feature produced a table whose schema carries metadata columns the written data never fills.Changes
create_table, gated onfeaturesand defaulting to enabled when absent, so call sites that pass nothing behave exactly as before. The per-targetDISABLE_OPERATIONAL_METADATAconfig flag still wins, since it nulls the schema at construction.features=self.featuresat the twodataflow.pycall sites that omitted it (streaming table and staging tables). The MV site already passes it, and the deferral also fixes the MV variant, where the data was gated but a schemaPath-backed schema was still augmented at init._add_columnsis name-idempotent, so the SCD2 and quarantine columns added between construction and creation are unaffected. Quarantine tables are built without aschemaPathand never had the problem.Tests
Four new unit tests in
tests/unit/dataflow/test_target_base.pycovering: features off, features on, features absent (defaults to enabled), and the config flag overriding an enabled features flag. Unit suite shows no new failures.Opened as draft alongside a comment on #97; happy to adjust the approach if you'd prefer a different shape.