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-2601] [Bug] Support model v0 for "latest" ref resolution #7704

Closed
Tracked by #7372
jtcohen6 opened this issue May 25, 2023 · 0 comments · Fixed by #7712
Closed
Tracked by #7372

[CT-2601] [Bug] Support model v0 for "latest" ref resolution #7704

jtcohen6 opened this issue May 25, 2023 · 0 comments · Fixed by #7712
Assignees
Labels
bug Something isn't working model_versions
Milestone

Comments

@jtcohen6
Copy link
Contributor

community Slack thread

Hey, is there a reason behind using <model>_v0 as model version makes dbt throws a Unhandled error while executing when compiling a model referring to the versioned model? I can run the versioned model with no problem but models referring to it will fail.
Switching from v0 to v1 works as expected.

I think it's just that this line (which is there for type checking):

assert node.latest_version # for mypy, whenever i may find it

Should be changed to:

assert node.latest_version is not None

Because 0 is falsy, but it is not None

Reproduction/test case

# models/my_model.yml
models:
  - name: my_model
    versions:
      - v: 0
-- models/my_model_v0.sql
select 1 as id
-- models/another.sql
select * from {{ ref('my_model') }}
@jtcohen6 jtcohen6 added bug Something isn't working model_versions labels May 25, 2023
@jtcohen6 jtcohen6 added this to the v1.5.x milestone May 25, 2023
@github-actions github-actions bot changed the title [Bug] Support model v0 for "latest" ref resolution [CT-2601] [Bug] Support model v0 for "latest" ref resolution May 25, 2023
@gshank gshank self-assigned this May 26, 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_versions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants