fix(cdp): pass schema as runtime option and add typed join handling - #224
Merged
iht merged 2 commits intoAug 24, 2026
Merged
Conversation
iht
approved these changes
Aug 24, 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.
Fixes #88, Fixes #89
What was wrong
pipelines/cdp/cdp_pipeline/customer_data_platform.py, the BigQuery output schema was read directly at module import time with a hardcoded relative path (with open("./schema/unified_table.json", encoding="utf-8")). When the package was installed on Dataflow workers or executed outside thepipelines/cdpdirectory, the relative path failed withFileNotFoundError.left_join,coupon_redempt_valuelacked proper type annotations and type checks, triggering linter warnings regarding dictionary subscriptability onOptionaltypes.What changed
load_output_schema(schema_path)helper function that supports custom schema paths, package-relative fallback paths, and embedded default schema definitions.--output_schema_pathargument toMyPipelineOptionsinpipelines/cdp/cdp_pipeline/options.py.create_and_run_pipelineto load and pass the schema dynamically at pipeline launch time.left_joinfor clean linter validation.pipelines/cdp/tests/test_customer_data_platform.pycovering matching joins, non-matching joins, schema loading, and Beam pipeline transformation execution withTestPipeline.Verification
yapf -i -r --style yapf .-> clean formattingpylint --rcfile ../pylintrc cdp_pipeline tests-> 10.00/10 ratingpytest tests/-> 4 passedpython setup.py sdist-> package builds successfully