Skip to content

Fix: unique, user-friendly audit names for custom named dbt tests#5484

Merged
treysp merged 3 commits intomainfrom
trey/dbt-test-names
Oct 6, 2025
Merged

Fix: unique, user-friendly audit names for custom named dbt tests#5484
treysp merged 3 commits intomainfrom
trey/dbt-test-names

Conversation

@treysp
Copy link
Contributor

@treysp treysp commented Oct 3, 2025

dbt does not automatically generate a unique, user-friendly name for tests whose name field is populated in their YAML definition - this can result in duplicate names.

We can use the unique_id, but its hash is not user-friendly. Therefore, we construct a name equivalent to those of tests with default names.

Note: there is no way to statically determine whether a test's name field was specified based solely on the manifest node. Therefore, we must construct the default auto-generated name to determine whether we need to construct the custom name.

Ref: https://github.com/dbt-labs/dbt-core/blob/db9a6e10c17c709e87b30f964c25b715536393f9/core/dbt/parser/generic_test_builders.py#L279

@treysp treysp force-pushed the trey/dbt-test-names branch 2 times, most recently from 430b68c to 5415b5c Compare October 6, 2025 17:51
@treysp treysp force-pushed the trey/dbt-test-names branch from 5415b5c to 65774e6 Compare October 6, 2025 19:47
@treysp treysp force-pushed the trey/dbt-test-names branch from c1f9c13 to b2e383f Compare October 6, 2025 21:14
@treysp treysp merged commit a303011 into main Oct 6, 2025
34 of 37 checks passed
@treysp treysp deleted the trey/dbt-test-names branch October 6, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants