Update Manifest v12 and run-results v6 json schemas
User description
Update Manifest v12 and run-results v6 json schemas
PR Type
Enhancement, Bug fix
Description
-
Updated
dbt_versiondefault values in multiple schemas to1.10.0a1. -
Introduced new
freshnessproperty inmanifest_v12schema with nested configurations. -
Replaced enumerations with string types for granularity and grain-related fields in schemas.
-
Added new
no-opstatus torun-results_v6schema.
Changes walkthrough 📝
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Enhancement |
|
Need help?
Type /help how to ...in the comments thread for any question about Qodo Merge usage.Check out the documentation for more information.
Walkthrough
The pull request introduces significant changes to the manifest_v12.py and run_results_v6.py files in the dbt artifacts parser. In manifest_v12.py, new classes like Period, DependsOn5, BuildAfter, and Freshness are added, and multiple existing classes are updated to use new dependency and freshness-related types. The run_results_v6.py file sees minor updates, including a dbt version change and the addition of a no_op status to the Status enum.
Changes
| File | Changes |
|---|---|
dbt_artifacts_parser/parsers/manifest/manifest_v12.py |
- Added new classes: Period, DependsOn5, BuildAfter, Freshness - Updated Nodes class with optional freshness attribute - Numerous classes updated to use new DependsOn6 and DependsOn18 dependency types |
dbt_artifacts_parser/parsers/run_results/run_results_v6.py |
- Updated dbt_version from '1.9.0b2' to '1.10.0a1' - Added no_op status to Status enum |
Sequence Diagram
sequenceDiagram
participant Manifest as ManifestV12
participant Nodes as NodesClass
participant Freshness as FreshnessClass
participant Dependency as DependencyClass
Manifest->>Nodes: Add optional freshness attribute
Nodes->>Freshness: Create freshness configuration
Manifest->>Dependency: Update dependency types
Dependency->>Nodes: Apply new dependency management
Possibly related PRs
- #75: Adds support for
ManifestV12 - #77: Updates README for manifest version 12 support
- #79: Updates
parse_manifestfunction to support additional manifest versions
Poem
🐰 Manifest magic, version twelve's dance, Dependencies twirl in a new-found trance Freshness blooms like a rabbit's spring leap Parsing artifacts, no detail too deep! Code evolves with each hoppy embrace 🌱
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between b7d4dbafbfb2ff401fdfc8d86026c169e47e1899 and da28ae4ed180b63baf276b55aeaa19730ac76cf4.
⛔ Files ignored due to path filters (2)
-
dbt_artifacts_parser/resources/manifest/manifest_v12.jsonis excluded by!**/*.json -
dbt_artifacts_parser/resources/run-results/run-results_v6.jsonis excluded by!**/*.json
📒 Files selected for processing (2)
-
dbt_artifacts_parser/parsers/manifest/manifest_v12.py(63 hunks) -
dbt_artifacts_parser/parsers/run_results/run_results_v6.py(2 hunks)
🔇 Additional comments (28)
dbt_artifacts_parser/parsers/manifest/manifest_v12.py (26)
20-20: Updatedbt_versioninMetadataclassThe
dbt_versiondefault value has been updated to'1.10.0a1'in theMetadataclass. This change ensures the metadata reflects the correct dbt version corresponding to the updated schemas.
825-850: Add model freshness configurationsNew classes
Period,DependsOn5,BuildAfter, andFreshnesshave been introduced to support model freshness configurations. These additions enhance the ability to specify when models should be rebuilt based on time periods and dependencies.
902-902: Includefreshnessattribute inNodes4classThe optional
freshnessattribute has been added to theNodes4class, allowing models to define freshness criteria directly. This is consistent with the additions of the freshness-related classes.
967-973: Update dependency structures in node classesThe new
DependsOn6class has been defined, and thedepends_onattribute inNodes5,Nodes6, andNodes7has been updated to useDependsOn6. This update reflects the changes in dependency management and improves consistency across node types.Also applies to: 1018-1018, 1124-1124, 1330-1330
1367-1367: Enhance source freshness configurationsThe
Freshness1class has been added to define freshness criteria for sources withwarn_after,error_after, andfilterattributes. TheSourcesclass now includesloaded_at_queryandfreshnessattributes. These enhancements provide more flexibility in source freshness definitions.Also applies to: 1455-1456
1472-1472: Update macro dependency trackingA new
DependsOn9class has been introduced for macros, and thedepends_onattribute in theMacrosclass now usesDependsOn9. This change unifies the dependency tracking mechanism for macros.Also applies to: 1504-1504
1558-1558: Update dependencies inExposuresThe
DependsOn10class has been added, and thedepends_onattribute inExposuresnow uses it. This ensures that exposures correctly reference their dependencies.Also applies to: 1587-1587
Line range hint
1657-1668: Enhance metric type parametersUpdates have been made to metric-related classes such as
Numerator,Denominator,OffsetWindow, andMetric, including new attributes likeoffset_to_grain. These enhancements provide greater flexibility in metric calculations.Also applies to: 1685-1686, 1694-1694, 1725-1726
1800-1801: UpdateCumulativeTypeParamswith optionalwindowThe
CumulativeTypeParamsclass now includes an optionalwindowattribute, allowing more control over cumulative metric calculations.
1873-1879: AdjustMetricstime granularity typeThe
time_granularityattribute in theMetricsclass has been changed from a specificGranularityenum to a genericstrtype. This change simplifies the specification of time granularity for metrics.
1980-1980: Update dependency management in disabled nodesThe
DependsOn12andDependsOn13classes have been introduced, and thedepends_onattribute in various disabled node classes now uses them. This ensures consistent dependency structures across all node types, including disabled ones.Also applies to: 2069-2069, 2135-2135, 2186-2186, 2283-2283
2406-2406: Updatedepends_oninDisabled3The
depends_onattribute inDisabled3has been updated to useDependsOn13, aligning it with the new dependency classes.
2578-2598: AddBuildAfter1andFreshness2classesNew classes
DependsOn17,BuildAfter1, andFreshness2have been added to support freshness configurations in disabled models. These classes mirror earlier additions for model freshness.
Line range hint
2633-2649: IncludefreshnessinDisabled4The
freshnessattribute has been added to theDisabled4model definitions, enabling freshness configurations for disabled models.
2714-2721: Update dependencies in disabled SQL operations and testsThe
DependsOn18class has been introduced, and thedepends_onattribute inDisabled5andDisabled6now uses it. This ensures consistent dependency tracking across disabled SQL operations and tests.Also applies to: 2765-2765, 2862-2862
3057-3057: Updatedepends_oninDisabled7The
depends_onattribute inDisabled7usesDependsOn18, maintaining consistency in dependency management for disabled snapshots.
3084-3084: Enhance freshness configurations in disabled sourcesThe
Freshness3class has been added, and theloaded_at_queryandfreshnessattributes are now included inDisabled8. This supports freshness configurations in disabled sources.Also applies to: 3161-3162
3215-3215: Updatedepends_onin disabled exposuresThe
depends_onattribute inDisabled9now usesDependsOn18, aligning with the updated dependency structure.
Line range hint
3280-3317: Enhance metric parameters in disabled metricsUpdates have been made to metric type parameters in disabled metrics, including new attributes like
offset_windowandoffset_to_graininNumerator1,Denominator1, andMetric1. These changes enhance the functionality of disabled metrics.Also applies to: 3364-3373, 3386-3386
3435-3441: Update dependencies in disabled metricsThe
depends_onattribute inDisabled10now usesDependsOn18, ensuring consistent dependency tracking.
3537-3540: Updatedepends_onin disabled saved queriesThe
depends_onattribute inDisabled11usesDependsOn18, maintaining consistency in dependency management for disabled saved queries.
3567-3573: Introduce entities, measures, and dimensions in semantic modelsNew classes and enums such as
Entity,Measure2,Dimension, andTimeGranularityhave been added to define entities, measures, and dimensions within semantic models. These additions provide a structured approach to semantic model definitions.Also applies to: 3584-3584, 3642-3642, 3650-3663, 3700-3700, 3711-3711, 3741-3744
Line range hint
3784-3819: Add definitions for disabled unit testsClasses related to unit tests, including
GivenItem,Expect,Overrides, andDisabled13, have been added. These allow the definition of unit tests for models, even when they are disabled.
3901-3907: Updatedepends_oninSavedQueriesThe
depends_onattribute inSavedQueriesnow usesDependsOn18, ensuring consistent dependency tracking.
3917-3923: Enhance semantic models with additional classesAdditional classes and updates have been made to semantic models, including
Entity1,Measure3, andDimension1. These enhancements expand the capabilities and definitions within semantic models.Also applies to: 3934-3934, 3959-3959, 3995-3995, 4006-4006, 4036-4039
Line range hint
4064-4091: Add unit test definitionsNew classes for unit tests (
GivenItem1,Expect1,UnitTests) have been added, allowing for the definition and tracking of unit tests within the manifest.dbt_artifacts_parser/parsers/run_results/run_results_v6.py (2)
19-19: Updatedbt_versioninMetadataclassThe
dbt_versiondefault value has been updated to'1.10.0a1'in theMetadataclass. This change ensures thatrun_results_v6aligns with the updated dbt version.
30-30: Addno_opstatus toStatusenumThe
no_opvalue has been added to theStatusenum. This addition allows the parser to handle tasks with a 'no-op' status, improving the representation of operation statuses.
Finishing Touches
- [ ] 📝 Generate Docstrings (Beta)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. (Beta) -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
| ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪ |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
⚡ Recommended focus areas for reviewData Validation
|
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Score |
| General |
Add string pattern validation to ensure granularity values remain consistent with previously allowed valuesConsider adding validation constraints or a pattern property to ensure that the dbt_artifacts_parser/resources/manifest/manifest_v12.json [9015-9016]
Suggestion importance[1-10]: 8Why: The suggestion addresses a potential data consistency issue by ensuring that string values for granularity still follow the previously defined enum values, preventing invalid inputs while maintaining flexibility. | 8 |
Use proper enum value instead of string literal for enum field default valueThe default value for dbt_artifacts_parser/parsers/manifest/manifest_v12.py [841]
Suggestion importance[1-10]: 7Why: Using a string literal instead of the proper enum value for an enum field's default value could lead to type errors and inconsistencies. The suggestion correctly recommends using Period.hour for better type safety. | 7 |
@SumanMaharana Thank you for the contribution. However, I want to catch up with only the stable version, as the schema can be changed while releasing the next stable version.
https://github.com/yu-iskw/dbt-artifacts-parser/blob/main/CONTRIBUTING.md#implementation-policy
@SumanMaharana Thank you for the contribution. However, I want to catch up with only the stable version, as the schema can be changed while releasing the next stable version.
https://github.com/yu-iskw/dbt-artifacts-parser/blob/main/CONTRIBUTING.md#implementation-policy
@yu-iskw So this can only be accepted after the release of dbt-core v1.10 ?
I have picked up the manifest and run_results from the dbt-core main
@SumanMaharana The main branch of dbt-core is in the middle of the development to 1.10 now. The latest stable version is at the tag v1.9.1. The manifest v12 and run results v6 in this repository come from v1.9.1.
https://github.com/dbt-labs/dbt-core/releases/tag/v1.9.1
I suppose that dbt-artifacts-parser v0.8.2 should work as long as you use a stable version of dbt-core. Did you encounter any issue with incompatibility to your dbt environment?
@yu-iskw I used the artifacts generated by the dbt cloud. While parsing those artifacts, validation errors are being thrown for the entire manifest file and the run_results file.
@SumanMaharana I see. Do the schemas on the main branch work? I want to have the error logs, if you don't mind. As I don't use dbt Cloud, I can't try out dbt-artifacts-parser on dbt artifacts generated by dbt Cloud.
@SumanMaharana I see. Do the schemas on the
mainbranch work? I want to have the error logs, if you don't mind. As I don't use dbt Cloud, I can't try out dbt-artifacts-parser on dbt artifacts generated by dbt Cloud.
The Error is on the whole manifest file(its too long to be shared here) you can just use this manifest file and run it it generates the same error. If you still wanna have a look ill share with you the whole error
@SumanMaharana Let me clarify what you did. Did you try to parse this manifest file with dbt-artifacts-parser? This package is used for parsing dbt artifacts, not for those JSON schemas.
@SumanMaharana Let me clarify what you did. Did you try to parse this manifest file with dbt-artifacts-parser? This package is used for parsing dbt artifacts, not for those JSON schemas.
@yu-iskw Nope ohh my bad i pasted the wrong link in there. i know that manifest is used to generate the python model its not the actual manifest.
I used the artifact generated by the dbtcloud workflow after a dbt job is being run.