Skip to content

Conversation

@physcat
Copy link
Contributor

@physcat physcat commented Nov 14, 2025

Problem

Resolves #1135

When running dbt docs generate, agate emits RuntimeWarnings for columns specified in text_only_columns that don't exist in the catalog results:

"table_owner" does not match the name of any column in this table.

This happens because some adapter implementations (e.g., BigQuery, Athena) don't return all the metadata columns that were added to the text_only_columns list in PR #1057, specifically the table_owner column.

Solution

This PR takes a defensive approach by filtering the text_only_columns list at runtime to only include columns that actually exist in the returned catalog data. This prevents warnings when adapters return different metadata columns while still ensuring all returned columns are properly typed as text.

Alternative Approach Note: I want to acknowledge PR #1404 by @morgan-dgk which addresses the same issue by removing table_owner from the base implementation and moving it to adapter-specific implementations. That's a valid architectural approach, and since that PR is already in progress, I'm happy to close this PR if the team prefers that solution.

The key difference between the two approaches:

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@physcat physcat requested a review from a team as a code owner November 14, 2025 15:29
@cla-bot cla-bot bot added the cla:yes The PR author has signed the CLA label Nov 14, 2025
@physcat physcat force-pushed the fix-bq-table-owner-warning branch from b3baa3f to 20794e8 Compare November 14, 2025 15:31
@physcat physcat force-pushed the fix-bq-table-owner-warning branch from 20794e8 to cdabad2 Compare November 27, 2025 08:50
… warnings

BigQuery's catalog macro does not return a 'table_owner' column, but the base
adapter implementation was attempting to force this column to text type.
This caused agate to emit RuntimeWarnings during 'dbt docs generate':

  "table_owner" does not match the name of any column in this table.

This change makes the implementation more defensive by filtering the
text_only_columns list to only include columns that actually exist in
the table. This prevents warnings when adapters return different metadata
columns while still ensuring all returned columns are properly typed as text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes The PR author has signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] (BigQuery) docs generate: "table_owner" does not match the name of any column in this table

1 participant