dbt-docs icon indicating copy to clipboard operation
dbt-docs copied to clipboard

[CT-2332] [CT-2330] [Bug] Documentation for csv files is not displaying the table name in the Example SQL section

Open andrea-montes-yello opened this issue 2 years ago • 7 comments

Is this a new bug in dbt-core?

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

Current Behavior

after running dbt docs serve, the documentation tied to a seed csv file is not showing the table name in the example SQL section. Instead of the table name, it is displaying undefined.

Expected Behavior

The table name should be displayed in the section Example SQL

Steps To Reproduce

  1. Create documentation for a seed file
  2. dbt docs generate
  3. dbt docs serve
  4. Navigate to the seed documentation
  5. Check what's in the section Example SQL

Relevant log output

No response

Environment

- OS: Mac OS monterrey 12.5.1
- Python: Python 3.8.9
- dbt: 1.3.1

Which database adapter are you using with dbt?

postgres

Additional Context

No response

andrea-montes-yello avatar Mar 28 '23 14:03 andrea-montes-yello

Good find @andrea-montes-yello !

I think the fix could be as simple as updating this: https://github.com/dbt-labs/dbt-docs/blob/ac6670cad4eb60356b50eec23496aa56c6774635/src/app/services/code_service.js#L59

To this instead:

        const rel = database + model.schema + "." + model.name;

Going to label as a good_first_issue for a community member to pick up.

dbeatty10 avatar Mar 28 '23 15:03 dbeatty10

Supposing the user has dbt-duckdb installed, the reprex ("reproducible example") is as simple as:

dbt_project.yml

name: "my_dbt_project"
version: "1.0.0"
config-version: 2
profile: "sandcastle-duckdb"

seeds/my_seed.csv

id,fruit
1,orange

profiles.yml

sandcastle-duckdb:
  target: dev
  outputs:
    dev:
      type: duckdb
      schema: dev
      path: 'triage.duckdb'
      threads: 1

dbeatty10 avatar Mar 28 '23 16:03 dbeatty10

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.

github-actions[bot] avatar Mar 23 '24 01:03 github-actions[bot]

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.

github-actions[bot] avatar Mar 31 '24 01:03 github-actions[bot]

I just noticed this issue still persists with the latest dbt 1.8. It'd be great if this could be re-opened and addressed!

bdtoole avatar Aug 02 '24 20:08 bdtoole

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.

github-actions[bot] avatar Jul 29 '25 02:07 github-actions[bot]

Commenting to keep this alive.

bdtoole avatar Jul 30 '25 17:07 bdtoole