Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from WritableManifest -> Manifest to represent deferred manifest internally #9544

Merged
merged 12 commits into from
Feb 27, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Feb 9, 2024

resolves #9567

Problem

Currently, PreviousState reads in a manifest artifact and uses the resulting WritableManifest object for state comparison downstream. With the artifacts restructuring happening as part of #9099, the WritableManifest class will contain 'resource' classes that don't have the requisite methods implemented.

Solution

  • Introduce Manifest.from_writable_manifest classmethod constructor that converts resources to nodes
    • for each resource collection, map it to dictionary o f nodes using the node.from_resource methods.
    • leverage new RESOURCE_CLASS_TO_NODE_CLASS to lookup resource class to node class, since resources are not aware of nodes.
  • use from_writable_manifest to convert to a Manifest on PreviousState.manifest explicitly
  • Update typing as appropriate for users of PreviousState.manifest (e.g. clone & runnable tasks, selector methods)

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@cla-bot cla-bot bot added the cla:yes label Feb 9, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: Patch coverage is 98.52941% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.01%. Comparing base (7329143) to head (6b70358).

Files Patch % Lines
core/dbt/contracts/graph/manifest.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9544      +/-   ##
==========================================
- Coverage   88.01%   88.01%   -0.01%     
==========================================
  Files         178      178              
  Lines       22375    22413      +38     
==========================================
+ Hits        19694    19727      +33     
- Misses       2681     2686       +5     
Flag Coverage Δ
integration 85.47% <98.52%> (+<0.01%) ⬆️
unit 62.23% <95.58%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichelleArk MichelleArk changed the title first pass: from_writable_manifest Convert from WritableManifest -> Manifest to represent deferred manifest internally Feb 13, 2024
@MichelleArk MichelleArk added the artifact_minor_upgrade To bypass the CI check by confirming that the change is not breaking label Feb 26, 2024
@MichelleArk MichelleArk marked this pull request as ready for review February 27, 2024 18:47
@MichelleArk MichelleArk requested a review from a team as a code owner February 27, 2024 18:47
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@MichelleArk MichelleArk merged commit 9d23239 into main Feb 27, 2024
62 of 63 checks passed
@MichelleArk MichelleArk deleted the previous-state-manifest branch February 27, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifact_minor_upgrade To bypass the CI check by confirming that the change is not breaking cla:yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Artifacts] Use Manifest instead of WritableManifest in PreviousState and _get_deferred_manifest
2 participants