Skip to content

Return column comments in SQLAlchemy get_columns - #618

Merged
hashhar merged 1 commit into
trinodb:masterfrom
hashhar:hashhar/581-column-comments-sqlalchemy
Jul 16, 2026
Merged

Return column comments in SQLAlchemy get_columns#618
hashhar merged 1 commit into
trinodb:masterfrom
hashhar:hashhar/581-column-comments-sqlalchemy

Conversation

@hashhar

@hashhar hashhar commented Jul 11, 2026

Copy link
Copy Markdown
Member

Description

Include the hidden information_schema.columns.comment column in the dialect's _get_columns query so that SQLAlchemy's Inspector.get_columns() exposes column comments via the ReflectedColumn comment field.

Non-technical explanation

Fixes #581

Release notes

( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:

* Return column comments in SQLAlchemy get_columns. ({issue}`581`)

@cla-bot cla-bot Bot added the cla-signed label Jul 11, 2026
@hashhar
hashhar force-pushed the hashhar/581-column-comments-sqlalchemy branch from 531203f to 2e53a8e Compare July 11, 2026 10:48
Include the hidden information_schema.columns.comment column in the
dialect's _get_columns query so that SQLAlchemy's
Inspector.get_columns() exposes column comments via the ReflectedColumn
comment field.
@hashhar
hashhar force-pushed the hashhar/581-column-comments-sqlalchemy branch from 2e53a8e to 7dbddd0 Compare July 11, 2026 11:15

@azawlocki-sbdt azawlocki-sbdt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hashhar

hashhar commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6422a0b1-df81-47ee-8239-32b3d963e062

📥 Commits

Reviewing files that changed from the base of the PR and between 7b74702 and 7dbddd0.

📒 Files selected for processing (2)
  • tests/integration/test_sqlalchemy_integration.py
  • trino/sqlalchemy/dialect.py

📝 Walkthrough

Walkthrough

The SQLAlchemy dialect’s column metadata query now retrieves the comment field from information_schema.columns and includes it in each reflected column dictionary. A version-gated integration test creates a table with commented and uncommented columns, validates the values returned by Inspector.get_columns(), and cleans up the table.

Assessment against linked issues

Objective Addressed Explanation
Return column comments from Inspector.get_columns() [#581]

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hashhar
hashhar merged commit b2956b3 into trinodb:master Jul 16, 2026
12 checks passed
@hashhar
hashhar deleted the hashhar/581-column-comments-sqlalchemy branch August 14, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

[Feature Request] Retrieve column comments for SQLAlchemy Inspector#get_columns

2 participants