dbt-coverage
dbt-coverage copied to clipboard
Aliases mess up coverage
Using aliases messes up the coverage.
In load_files the table name is not the same for catalog & manifest, as such when doing manifest.XXX.get(table_name, {}) it returns nothing.
This comes from the fact that in Table.from_node() the Table is initialized with the alias instead of the model name.
One simple solution would be to use the unique_id as identifier. It means:
- changing
Manifest.full_table_nametoreturn table["unique_id"].lower() - changing
Table.from_nodetoreturn Table(node["unique_id"], ...)
Thanks for the suggestion @Mavtti!
@sweco I guess this is something worth thinking about for the future -- aliases are a pretty nice feature worth supporting 🙂
@Mavtti I believe with the new release, we should be closer to this than ever. Would you be up for sending a quick PR that would refactor the behaviour of Table.from_node()?
Thanks!