[CT-2332] [CT-2330] [Bug] Documentation for csv files is not displaying the table name in the Example SQL section
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
- Create documentation for a seed file
- dbt docs generate
- dbt docs serve
- Navigate to the seed documentation
- 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
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.
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
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.
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!
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.
Commenting to keep this alive.