Skip to content

Conversation

@morgan-dgk
Copy link

Problem

PR #1057 added several new column names to the text_only_columns arg to the table_from_rows call in the _catalog_filter_table class method. This method is called as part of the dbt docs generate task.

However, some of the new column names included are not included in the list of columns returned by certain adapter implementations for the __get_catalog and __get_catalog_relations.
For example, the relevant BigQuery and Athena macros do not return a column named table_owner (see #1135).

This results in the agate type checker emitting a warning when attempting typing checking runs.

Solution

Any columns added to the text_only_columns argument for the call to table_from_rows in the base implementation should presumably be columns that are returned by all adapters implementations.

This PR removes the table_owner name from the list of text_only_columns included in the base implementation of _catalog_filter_table and moves this to a Snowflake-specific adapter implementation.

I investigated whether agate provides a means of suppressing this warning but there does not appear to be a mechanism to do so. Additionally, I am unsure whether this would be desirable.

resolves #1135

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

@cla-bot
Copy link

cla-bot bot commented Oct 23, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Morgan Kerle.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

PR dbt-labs#1057 added several new column names to the `text_only_columns` arg
to the `table_from_rows` call in the `_catalog_filter_table` class
method. This method is called as part of the `dbt docs generate` task.

However, some of the new column names included are not included in
the list of columns returned by certain adapter implementations for the
`__get_catalog` and `__get_catalog_relations`.
For example, the relevant BigQuery and Athena macros do not return a
column named `table_owner` (see dbt-labs#1135).

This results in the agate type checker emitting a warning when
attempting typing checking runs.

Any columns added to the `text_only_columns` argument for the call to
`table_from_rows` in the base implementation should presumably be
columns that are returned by all adapters implementations.
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change in the dbt-adapters package. For details on how to document a change, see the Contributing Guide.

@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change in the dbt-snowflake package. For details on how to document a change, see the Contributing Guide.

Comment on lines 121 to +125
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move imports above comment

Suggested change
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.

table = table_from_rows(
table.rows,
table.column_names,
text_only_columns=[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one other option here would be to add a method that adapters implement to override this instead of needing to override the whole method

i.e.

def _get_text_only_cols() -> List[str]
    return [...]

Then we snowflake / whomever can implement this method to override the default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:approve-public-fork-ci 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

2 participants