dbt-labs / dbt-labs/agents_schema
TableSchema.name duplicates AGENTS_SCHEMA; collapse the redundancy
- Dominant language
- Python
- Stars
- 48
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Every table literal carries a qualified name (`TableSchema("AGENTS.DBT_MODEL", ...)`), but every writer ignores the prefix and builds physical names as `f"{AGENTS_SCHEMA}.{table.base_name}"`. The prefix is a label with nothing validating it against the constant, so the label and physical reality can drift. They already did: the constant said `agents` while Snowflake stored `AGENTS` (#42).
Two coherent fixes, pick one:
1. Store base names only (`TableSchema("DBT_MODEL", ...)`) and derive the qualified name from the constant where a label is needed.
2. Make `name` authoritative: writers use `table.name` directly and drop the constant.
Option 1 keeps the single placement switch; option 2 makes each literal self-contained but scatters the schema name across eight files. Leaning option 1.
Tests assert on `table.name` as a label (`FakeDestination`), so either change ripples there mechanically.
Contributor guide
Assessment
This issue has not been assessed yet.