dbt-labs/dbt-docs

[CT-2906] [CT-2883] [Bug] Versioned models are appear with the same name in docs

Jaxing opened this issue · 5 comments

Jaxing commented

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

When creating versions of a model I have one model called abc_v1 and one model called abc_v2 however when generating the docs they both appear as abc in the model overview (see first image below).
If you look in the side menu the model version is included (see second image).
In my production environment I have also managed to make the version disappear from the side menu (see third image), but I can't reproduce that so it might be something specific to our prod environment.

Expected Behavior

I would expect the name to be abc_v1 or abc.v1 instead of abc. Preferable I would like to have one view for the both of them and be able to select version from a dropdown, but as a starting point I think that just printing the full name of the model would be good.

It feels like it might be because the node name for the models in the manifest is ...<model_name>.v and maybe it's hard coded somewhere that the name in the docs should be split(node, '.')[2] or something like that?

Steps To Reproduce

Running dbt-core 1.5.2 dbt-bigquery 1.5.1.

create two models:
abc_v1
abc_v2

generate and serve docs

example files:

abc_v1.sql

{{
    config(
        materialized='view'
    )
}}
select 1 as a, 2 as b, 3 as c

abc_v2.sql

{{
    config(
        materialized='view'
    )
}}
select * from {{ ref('abc', v='1') }}

abc.yaml

version: 2

models:
  - name: abc
    latest_version: 1
    config:
      contract: {enforced: true}
    columns:
      - name: a
        data_type: integer
      - name: b
        data_type: integer
      - name: c
        data_type: integer
    versions:
      - v: 1
      - v: 2

Relevant log output

No response

Environment

- OS: ubuntu 22.04
- Python: 3.8
- dbt-core: 1.5.2
- dbt-bigquery: 1.5.1

Which database adapter are you using with dbt?

bigquery

Additional Context

image1
image2
image3

Hey @Jaxing - is the ask here to include the version number in the title of the "model overview" page? It is included in the table of associated metadata:

256738808-73862a81-d359-43f9-911f-786e6c06d407

It also sounds like there's a flakey error where the version numbers aren't appearing in the sidebar, but it's been difficult to reproduce.

In any case, I'm going to move this over to the dbt-docs repo.

Jaxing commented

Thanks, for your reply 🙏🙂

Yes, I think that would be nicer. Or to only have one view for each model and switch between versions with a drop down.

Yes, I think that would be nicer.

Okay! We'll want to do the option that just updates the title rather than reorganizing the separate views into a single view.

How do these two different titles look?

Current

abc view
abc view

Proposed

abc (version 1) view
abc (version 2) view

The proposed titles would go here:

image

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.