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-3145] [Bug] partial parsing issue when adding private models to a new group #8697

Closed
2 tasks done
Tracked by #7979
dave-connors-3 opened this issue Sep 22, 2023 · 3 comments · Fixed by #8817
Closed
2 tasks done
Tracked by #7979
Assignees
Labels
backport 1.6.latest bug Something isn't working High Severity bug with significant impact that should be resolved in a reasonable timeframe

Comments

@dave-connors-3
Copy link
Contributor

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

loom explanation

adding multiple nodes that have a relationships to the same group with private access results in a parsing error:

Parsing Error
  Node model.mega_corp_big_co_inc.int_returns__unioned attempted to reference node model.mega_corp_big_co_inc.stg_tpcds_core__catalog_returns, which is not allowed because the referenced node is private to the 'sales_analytics' group.

in this case, int_returns__unioned is a child of stg_tpcds_core__catalog_returns, both were added to a newly-created group called sales_analytics and had access set to private, all of which happened between invocations of dbt.

Expected Behavior

everything should parse just fine! these are both private members of the same group and we love that

Steps To Reproduce

see loom!

Relevant log output

No response

Environment

- OS: mac
- Python: Python 3.9.16
- dbt: 1.6.0 and 1.6.3 (see loom)

Which database adapter are you using with dbt?

snowflake

Additional Context

i love dbt

@dave-connors-3 dave-connors-3 added bug Something isn't working triage labels Sep 22, 2023
@github-actions github-actions bot changed the title [Bug] partial parsing issue when adding private models to a new group [CT-3145] [Bug] partial parsing issue when adding private models to a new group Sep 22, 2023
@dbeatty10
Copy link
Contributor

Reprex (using the Loom as inspiration)

models/my_model_a

select 1 as id

models/my_model_b

select 2 as id

models/my_model_c

select * from {{ ref("my_model_a") }} union all
select * from {{ ref("my_model_b") }}

models/_models.yml

models:
  - name: my_model_a
  - name: my_model_b
  - name: my_model_c

Clean out any previous artifacts and compile in that fresh environment (everything should work fine):

dbt clean
dbt compile

Now update your models/_models.yml file like this:

groups:
  - name: sales_analytics
    owner:
      name: Sales Analytics
      email: sales@jaffleshop.com

models:
  - name: my_model_a
    access: private
    group: sales_analytics
  - name: my_model_b
    access: private
    group: sales_analytics
  - name: my_model_c
    access: private
    group: sales_analytics

Doing this will yield an error:

dbt compile

But doing this instead would have not yielded an error:

dbt --no-partial-parse compile

Either way, re-running this command a 2nd time worked for me:

dbt compile

@gshank
Copy link
Contributor

gshank commented Oct 12, 2023

This particular bug shouldn't happen in 1.5, so I'm removing the backport 1.5.latest label.

@graciegoheen graciegoheen added the High Severity bug with significant impact that should be resolved in a reasonable timeframe label Nov 15, 2023
@gshank
Copy link
Contributor

gshank commented Nov 15, 2023

This went out in 1.7 already, so it doesn't need backporting to 1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6.latest bug Something isn't working High Severity bug with significant impact that should be resolved in a reasonable timeframe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants