Repository navigation
refactor(dagster): load raw tables through a shared parquet loader and result builders - #98
Draft
tillywoodfield wants to merge 2 commits into
Draft
tillywoodfield wants to merge 2 commits into
tillywoodfield wants to merge 2 commits into
Conversation
Collaborator
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
What & why
The eight raw table assets and the eight raw metadata assets each repeated the same load code: create the schema, load the parquet file, count rows, and report
dagster/table_name,dagster/row_countand thetable_not_emptycheck. The parquet load is now one Dagster-free function besideload_extraction_metadata, and the result each asset returns is built in one place.Part of #36
Changes
src/dfo_pipelines/extraction/parquet.py:load_parquet, which loads a parquet file into a table on a DuckDB connection, aliasing columns by position when givenrenames(DAC's case-colliding columns)src/dfo_pipelines/defs/raw_tables.py:raw_table_result, with the table metadata and thetable_not_emptycheck, andmetadata_table_result, with the table metadata onlyload_parquetorload_extraction_metadataand return the matching result. Decorators, asset names, signatures and docstrings are unchanged.claude/skills/building-pipelines/references/layers.mdnames the four functions in the raw load stepNotes for reviewers
devand from this branch is identical, and every existing test passes with no test file edited.load_parquetandload_extraction_metadataare DuckDB-specific. When BigQuery support arrives, both get a BigQuery counterpart, which is when they move to wherever the warehouse operations end up.Testing: the full CI workflow ran locally (pre-commit,
dg check defs,dbt buildwith 1430 passing, pytest with 509 passed and 9 skipped). The raw table and raw metadata assets of the seven sources with local raw files were materialised ondevand on this branch into separate DuckDB files: all 14 tables have identical schemas and rows (up to 11.4 million rows for imputed multilateral sectors), and the metadata and check results match. Climate finance has no local raw files, so only its tests cover it.Checklist
Co-Authored-By: Claude noreply@anthropic.com