Skip to content

fix: skip forcing absent catalog metadata columns to Text - #1749

Open
emrekabalcii wants to merge 3 commits into
databricks:mainfrom
emrekabalcii:fix/catalog-text-only-columns-warning
Open

emrekabalcii wants to merge 3 commits into
databricks:mainfrom
emrekabalcii:fix/catalog-text-only-columns-warning

Conversation

@emrekabalcii

@emrekabalcii emrekabalcii commented Oct 27, 2026 •

Copy link
Copy Markdown

Resolves #1748

Description

_get_schema_for_catalog force-typed every name in CATALOG_TEXT_ONLY_COLUMNS as Text whenever the row list was non-empty. Rows come from column.to_column_dict(), which omits None-valued keys, so comment, table_owner and table_comment are often absent from the resulting table. agate then emits one RuntimeWarning per absent forced column per schema during dbt docs generate.

This change builds the type tester only from the metadata columns that are present in the rows. The Text forcing from #1428 (which fixes the cross-schema merge conflict in #1392) is unchanged for every column that exists, and an empty input still falls back to DEFAULT_TYPE_TESTER.

Tests: added test_get_schema_for_catalog__omitted_none_columns_emit_no_warnings, which uses rows without the None-valued keys (the real shape produced by to_column_dict) and turns RuntimeWarning into an error. It fails on main and passes with this change. The existing _catalog_row helper includes "comment": None, which is why #1428's tests did not catch this. Full unit suite: 1466 passed, 4 skipped; ruff check and ruff format --check clean. I did not run the functional/integration tests.

Checklist

  • 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
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.
  • [Optional] I have run the dbt-databricks-pr-ready project skill for this PR and addressed its merge-readiness feedback

Rows built by _get_columns_for_catalog omit None-valued keys, so comment,
table_owner and table_comment are often missing from the table. Forcing
them in build_type_tester made agate emit one RuntimeWarning per absent
column per schema during dbt docs generate. Only force the columns that
are present.

Signed-off-by: Emre Kabalci <9528391+emrekabalcii@users.noreply.github.com>
Signed-off-by: Emre Kabalci <9528391+emrekabalcii@users.noreply.github.com>
@emrekabalcii

Copy link
Copy Markdown
Author

Verified in a real dev workspace with dbt docs generate (dbt-core 1.12.0, both venvs identical except for this patch, dbt-databricks 1.12.8):

unpatched patched
RuntimeWarning: ... does not match the name of any column 204 0
catalog.json (excluding metadata) identical identical

Two patched runs also produced identical catalog.json files, so the output is stable. The patch only changes which columns are force-typed to Text; it does not affect any column that exists in the result.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  impl.py
Project Total  

This report was generated by python-coverage-comment-action

Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
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.

dbt docs generate emits RuntimeWarning "does not match the name of any column" for comment, table_owner, table_comment

2 participants