-
Notifications
You must be signed in to change notification settings - Fork 4
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
Component and group commands #47
Conversation
@dave-connors-3, I did some poking around, and I believe the proximal issue is that resource selection for The root cause, however, is a little deeper. In the According to spec models:
- name: example
group: foo
access: public Not necessarily correct models:
- name: example
group: foo
config:
access: public As a result, using the Having that been said, it looks like So to recap, we can likely work around this by writing |
alright @nicholasyager @graciegoheen After some more tweaking, i think we're in decent shape: New functionality:
After some testing, found a few more places where logic needed updating:
|
@dave-connors-3 Can you please demonstrate a reproducible case of this occurring? I'm not able to replicate using the create-group command in |
I think the issue is not with the command itself -- it runs properly and assigns the access as expected. The issue comes on the next dbt invocation, where the project fails to compile because we've made nodes that are connected in the DAG private. |
Very interesting and very odd! The docs would leave me to believe that referencing private models is allowed, so long as the referring model is in the same group. For example, This should be fine flowchart LR
subgraph group
private_model --> other_model
end
For example, This should raise an error flowchart LR
subgraph group
private_model
end
private_model --> other_model
|
@nicholasyager this may very well be a me problem! I'll see if i can reliably replicate the issue I was having |
@nicholasyager I have not yet resolved the conflicts here (which may help!) but i flipped the Checking the manifest, it looks like this falls into your diagram above -- Can you confirm whether this set of commands creates the same error on your side? If it does, I think this might be a core issue? |
@dave-connors-3 Thanks for the test case! I was able to replicate the issue, and it stems from the interaction of two defects. Defect 1: The model_yml.update({"access": access_type.value, "group": group.name})
models[model_name] = process_model_yml(model_yml) Defect 2: The model_yml.update({"config": {"contract": {"enforced": True}}}) Instead, this should access the config itself and then update that sub-dictionary. The combination of the two means that |
@nicholasyager I just also discovered this! shout out to ruamel for making the yaml edits 10000% easier to read! Will update! |
@nicholasyager should be ready to rock and roll! |
This PR attempts to unify the actions of group creation and contract creation into one
group
command, and adds aoperation
subgroup for the existing commands.This required a couple small logic adjustments to the grouper logic to handle cases where selection syntax includes non-model nodes. I slotted it in a couple places, but likely could push it further down into the group logic.
@nicholasyager I am a little stuck on the click stuff -- this draft seems to successfully pass args and run the
create_group
command when thegroup
command is called, but doesn't seem to do the same for the contract operations. Would love some guidance on this! Once we make that edit, I can add real tests to the test file.