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

[CT-2680] [Bug] Allow referencing private models within dbt show "inline" queries #7837

Closed
jtcohen6 opened this issue Jun 9, 2023 · 0 comments · Fixed by #7838
Closed

[CT-2680] [Bug] Allow referencing private models within dbt show "inline" queries #7837

jtcohen6 opened this issue Jun 9, 2023 · 0 comments · Fixed by #7838
Assignees
Labels
bug Something isn't working model_groups_access Issues related to groups
Milestone

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 9, 2023

Currently, dbt will raise a DbtReferenceError when trying to preview an --inline query that refs a private model, because the inline query is not part of the same model group as the private model.

In my opinion:

  • It should be possible to preview a private model, or a query that references that model
  • If you then save that query in a model in a different group, you'll start seeing the reference error — which makes sense!

Reproduction case

groups:
  - name: my_cool_group
    owner:
      name: Me

models:
  - name: my_model
    access: private
    config:
      group: my_cool_group
$ dbt show --inline "select * from {{ ref('my_model') }}"
22:51:45  Running with dbt=1.6.0-b2
22:51:45  Encountered an error:
Parsing Error
  Node sql operation.my_dbt_project.inline_query attempted to reference node model.my_dbt_project.my_model, which is not allowed because the referenced node is private to the my_cool_group group.

(While here: let's change the string rendering of sql operation to something without spaces - sqloperation)

Looms

Users running into this error in the dbt Cloud IDE:

@jtcohen6 jtcohen6 added bug Something isn't working model_groups_access Issues related to groups labels Jun 9, 2023
@jtcohen6 jtcohen6 added this to the v1.5.x milestone Jun 9, 2023
@github-actions github-actions bot changed the title [Bug] Allow referencing private models within dbt show "inline" queries [CT-2680] [Bug] Allow referencing private models within dbt show "inline" queries Jun 9, 2023
@jtcohen6 jtcohen6 self-assigned this Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working model_groups_access Issues related to groups
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant