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

parse group resource #6921

Merged
merged 8 commits into from
Feb 15, 2023
Merged

parse group resource #6921

merged 8 commits into from
Feb 15, 2023

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Feb 9, 2023

resolves #6822

Description

Checklist

@cla-bot cla-bot bot added the cla:yes label Feb 9, 2023
@MichelleArk MichelleArk changed the base branch from main to CT-1999/exposure-owner February 9, 2023 14:18
@MichelleArk MichelleArk force-pushed the CT-1989/parse-group-resource branch from b40bf3c to 6d68309 Compare February 9, 2023 14:34
@MichelleArk MichelleArk marked this pull request as ready for review February 9, 2023 15:04
@MichelleArk MichelleArk requested a review from a team February 9, 2023 15:04
@MichelleArk MichelleArk requested review from a team as code owners February 9, 2023 15:04
@MichelleArk MichelleArk requested review from stu-k, emmyoop, peterallenwebb and gshank and removed request for stu-k February 9, 2023 15:04
Base automatically changed from CT-1999/exposure-owner to main February 13, 2023 15:13
@MichelleArk MichelleArk force-pushed the CT-1989/parse-group-resource branch 2 times, most recently from 3abb842 to 4911ccc Compare February 13, 2023 17:42
@MichelleArk MichelleArk force-pushed the CT-1989/parse-group-resource branch from 4911ccc to f17b360 Compare February 14, 2023 02:37
@gshank
Copy link
Contributor

gshank commented Feb 14, 2023

I just merged some changes to tests/functional/artifacts/data/state/v8/manifest.json, you probably need to merge main.

@MichelleArk MichelleArk force-pushed the CT-1989/parse-group-resource branch from eb41482 to 7cf69a8 Compare February 14, 2023 04:40
@MichelleArk
Copy link
Contributor Author

@gshank - Thanks for letting me know! I've merged main, should be ready for review.

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.

@@ -903,6 +926,19 @@ def delete_schema_exposure(self, schema_file, exposure_dict):
elif unique_id in self.saved_manifest.disabled:
self.delete_disabled(unique_id, schema_file.file_id)

# groups are created only from schema files, so just delete the group
Copy link
Contributor

Choose a reason for hiding this comment

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

When there are references to groups in other nodes, then we'll have to go through and schedule every node with this groups for reparsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. That would also go for modifications to existing groups in addition to deletions, right?

I'm thinking it makes more sense to add that to the follow-up PR that parses group configs on group-able nodes: #6965.

Copy link
Contributor

Choose a reason for hiding this comment

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

We'd only need to reparse for modifications of existing groups if information from the group is pulled into the node that needs to be rebuilt. If we only have the name in the node then probably not.

Copy link
Contributor

Choose a reason for hiding this comment

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

On thinking about this... Would people be pulling group information into model jinja code? Like model.group.owner? Then we'd have to reparse.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're not storing any additional group information directly on the node, right? Users would need to look up .groups() in the manifest / flat_graph (a.k.a. {{ graph }} in Jinja code) to get information about the owner

Copy link
Contributor Author

@MichelleArk MichelleArk Feb 15, 2023

Choose a reason for hiding this comment

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

We're not storing any additional group information directly on the node, right? Users would need to look up .groups() in the manifest / flat_graph (a.k.a. {{ graph }} in Jinja code) to get information about the owner

Right - we're just storing the name. Changes to which will be captured as a deleted + new group. So {{ model.config.group }} would just be able to access the name, not owner.

We're not currently adding groups to the flat graph - should we be?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh, I'd just seen this change and thought we were.

I think we probably should. This feels like valid metadata that someone might want access to in the Jinja context (including the folks who maintain the dbt_artifacts package), and I can't see potential for anti-pattern shenanigans. (There are indeed some things we exclude from the flat_graph, such as macros. I would say that exclusion is somewhat intentional. I just remembered this issue that I tagged myself to refine forever ago: #4919)

It would just require an update to this method, and associated tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, makes sense! I had actually added it on first pass of this work but wasn't convinced it should be part of the flat graph so removed it. Will add now

@MichelleArk MichelleArk reopened this Feb 15, 2023
@MichelleArk MichelleArk merged commit b7884fa into main Feb 15, 2023
@MichelleArk MichelleArk deleted the CT-1989/parse-group-resource branch February 15, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1989] Parse group resource
4 participants