dbt-artifacts-parser icon indicating copy to clipboard operation
dbt-artifacts-parser copied to clipboard

add initial support for semantic_manifest files

Open MiConnell opened this issue 1 year ago • 2 comments

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

MiConnell avatar Aug 13 '24 00:08 MiConnell

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?

Share
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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to 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.yaml file 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.

coderabbitai[bot] avatar Aug 13 '24 00:08 coderabbitai[bot]

@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.

yu-iskw avatar Aug 13 '24 08:08 yu-iskw

@MiConnell Let me close this once. Please feel free to reopen it, when it gets ready.

yu-iskw avatar Aug 19 '24 00:08 yu-iskw

@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.

pgoslatara avatar Aug 27 '24 10:08 pgoslatara

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

yu-iskw avatar Sep 04 '24 05:09 yu-iskw

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.

MiConnell avatar Sep 04 '24 19:09 MiConnell

It is an example of semantic_manifest.json, not the JSON schema. We need the complete JSON schema to generate a pydantic class.

yu-iskw avatar Sep 05 '24 01:09 yu-iskw