Repository navigation
fix: detect publishing mode from the platform for target= pipelines (#250) - #538
Draft
riyaz-ali-mohammad wants to merge 1 commit into
Draft
riyaz-ali-mohammad wants to merge 1 commit into
riyaz-ali-mohammad wants to merge 1 commit into
Conversation
…atabrickslabs#250) Bronze tables were created in the pipeline's default schema instead of the onboarding-specified schema when the pipeline was configured with `target=`. `DataflowPipeline._is_dpm_enabled` only inspected `pipelines.schema`, which is unset for `target=` pipelines even when the platform reports default publishing mode. sdp-meta then used bare table names, and Lakeflow placed the tables in the pipeline's default schema. Read `effective_publishing_mode` from the pipelines API using the runtime `pipelines.id`, cache successes, API failures, and unrecognised modes per pipeline, and fall back to the `pipelines.schema` check when the platform result is unavailable. Tests: PlatformPublishingModeDetectionTests cover the platform-default and platform-legacy cases, API failure fallback, unknown mode, missing pipeline id, and caching of successes, failures, and unrecognised modes.
This branch has not been deployed
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 #250.
Supersedes the closed main-targeted #535. Raised against
v0.2.0per the release flow (issue_branch→release_branch→main).Problem
When a pipeline is configured with
target=(legacy publishing-mode spec) but the platform reportsDEFAULT_PUBLISHING_MODE, bronze tables land in the pipeline's default schema instead of the schema set in onboarding (bronze_database_dev).Root cause:
DataflowPipeline._is_dpm_enabledinferred the publishing mode only frompipelines.schema. That Spark conf is not set fortarget=pipelines, so sdp-meta fell back to bare table names. Lakeflow then created the tables in the pipeline's default schema.Fix
effective_publishing_modefrom the pipelines API viaWorkspaceClient().pipelines.get(pipeline_id=...), using the runtimepipelines.id.pipelines.schemacheck when the id is missing or the cached platform result isNone. Detection never fails a pipeline on its own.pipelines.schema is unsetas the cause.Tests
PlatformPublishingModeDetectionTests(9 tests): platform default wins whenpipelines.schemais unset (regression for Bronze Tables Not Created in Onboarding-Specified Schema #250), platform legacy wins over the conf, API failure falls back to conf, API failure without conf is legacy, unrecognised mode falls back, no pipeline id skips the API, and caching of successes, failures, and unrecognised modes.LegacyPublishingModeTests+ new tests: 28 passed locally.End-to-end verification (from the earlier #535 work)
Same serverless UC pipeline (
target=configured,pipelines.schemaunset, platform reportsDEFAULT_PUBLISHING_MODE), same onboarding spec, new tablecustomers_e2eonboarded to bronze schemasdpmeta_issue250_bronze. No monkeypatching; only the wheel changed.has_api_detectiondpm_enabledcustomers_e2ein bronze schemacustomers_e2einpl_defaultDEFAULT_PUBLISHING_MODEDraft / next steps
Per Ravi's feedback on #535:
Cache failed and unrecognized API results(done in this PR).v0.2.0after Add pluggable Lakeflow and DQX quality engines to v0.2.0 #534 merges, preserve v0.2.0 changelog content, then mark ready for review.This PR is a draft until step 3.