Skip to content

Long data quality test names exceed database test name max length #25435

@nickozilla

Description

@nickozilla

Affected module
We are ingesting our dbt test metadata into OpenMetadata, and often see the following error in our external ingestion job

ERROR [2026-01-21 10:04:55,509] [dw-157 - PUT /api/v1/dataQuality/testDefinitions] o.o.s.r.d.TestDefinitionResource - Got exception: [UnableToExecuteStatementException] / message [org.postgresql.util.PSQLException: ERROR: value too long for type character varying(512)

This is because the way dbt generates test names is quite generous unless a custom test name is provided, it generates the test name as

  • test name (not_null, unique, etc)
  • model name (or source/seed/snapshot)
  • column name (if relevant)
  • arguments (if relevant, e.g. values for accepted_values)

https://docs.getdbt.com/reference/resource-properties/data-tests#custom-data-test-name

So all of our accepted_values dbt tests, and many other similar tests are failing ingestion due to their test name length.

The fixes are:

  • Force all our dbt tests to make use of the custom test name
  • Write a flyway to modify the column type to handle the potentially quite long default

Version:

  • OS: Debian
  • Python version: python:3.11-slim-bookworm
  • OpenMetadata version: 1.11.5
  • OpenMetadata Ingestion package version: openmetadata-ingestion[bigquery,postgres,dbt,looker,presidio-analyzer]==1.11.5.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions