add initial support for semantic_manifest files
This PR begins the process for supporting semantic manifest files. I'd love your feedback on the logic I set up and if I missed anything. As of now, there's no semantic_manifest schema defined in dbt's schema site, but there's some discussion of that getting updated shortly. Fixes #105
Walkthrough
This change enhances the library's functionality by adding support for parsing semantic manifest files from DBT. It introduces a new function to handle JSON data structures specific to semantic manifests, expanding the parser's capabilities. Additionally, new data models are established for validation and organization, ensuring compliance and accuracy when handling these artifacts. Overall, this improvement aims to better integrate semantic artifacts into the existing framework.
Changes
| Files | Change Summary |
|---|---|
README.md, dbt_artifacts_parser/parser.py |
Introduced new function parse_semantic_manifest to handle semantic_manifest.json. |
dbt_artifacts_parser/parsers/semantic_manifest/__init__.py |
Added licensing information for legal compliance. |
dbt_artifacts_parser/parsers/semantic_manifest/semantic_manifest_v1.py |
Defined data models for semantic manifests using Pydantic for structure and validation. |
dbt_artifacts_parser/parsers/version_map.py |
Added SEMANTIC_MANIFEST_V1 constant to ArtifactTypes enumeration for semantic manifests. |
tests/parsers/test_utils.py, tests/test_parser.py |
Included imports and commented-out tests for future integration of semantic manifest parsing. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Add support for semantic manifest files (#105) | ✅ |
🐇 Hop along, hear the tale,
Semantic parsing now won't fail!
JSON files, both new and bright,
With models clear, they bring delight.
In the garden of code, we expand our view,
Thank you, dear devs, for all that you do! 🌼✨
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>. -
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 generate interesting stats about this repository and render them as a table. -
@coderabbitai show all the console.log statements in this repository. -
@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 as 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 resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
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.
@MiConnell Thank you for opening this. I want to support semantic_manifest.json after it is open-sourced, because we can't reproduce to generate the class without the schema.
@MiConnell Let me close this once. Please feel free to reopen it, when it gets ready.
@yu-iskw What actions do you need before this is considered ready? I see semantic_manifest.json listed here so I'm not sure what else is required before we can add this to dbt-artifacts-parser.
As far as I know, semantic_manifest.json isn't listed at the subsequent links, because it isn't a part of dbt-core I suppose. But, I don't know dbt Labs make it public. We need JSON schemas which are publicly available to maintain this project so that any developer of this project can regenerate pydantic classes.
- https://schemas.getdbt.com/
- https://github.com/dbt-labs/dbt-core/tree/main/schemas/dbt
To be fair the example semantic manifest file on the docs site wasn't even up to date, I opened a PR to add missing fields so who knows what the actual schema is.
It is an example of semantic_manifest.json, not the JSON schema. We need the complete JSON schema to generate a pydantic class.