refactor(pkg-py): SQLAlchemySource.get_schema() to use ColumnMeta pattern#203
Merged
refactor(pkg-py): SQLAlchemySource.get_schema() to use ColumnMeta pattern#203
SQLAlchemySource.get_schema() to use ColumnMeta pattern#203Conversation
Refactor SQLAlchemySource.get_schema() to match the structure used by IbisSource, DataFrameSource, and PolarsLazySource: - Add _make_column_meta() for SQLAlchemy type classification - Add _add_column_stats() for statistics collection via SQL - Use shared format_schema() for output formatting - Remove redundant _get_sql_type_name() method This creates consistency across all DataSource implementations and prepares for future adapter-based abstractions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cpsievert
commented
Jan 26, 2026
cpsievert
commented
Jan 26, 2026
cpsievert
commented
Jan 26, 2026
Remove reprex.py and test stub files that were accidentally included. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SQLAlchemySource.get_schema() to use ColumnMeta pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors
SQLAlchemySource.get_schema()to use the sameColumnMeta+format_schema()pattern already used byIbisSource,DataFrameSource, andPolarsLazySource. (#193, #191)Changes
self._columns_infoto cache inspector results_make_column_meta()static method: Classifies SQLAlchemy types into ColumnMeta (kind + sql_type)_add_column_stats()method: Collects statistics (min/max, distinct counts) via SQL_fetch_categorical_values()helper: Fetches unique values for categorical columnsget_schema(): Now just 5 lines using the helper methods andformat_schema()_get_sql_type_name(): Type classification now handled in_make_column_meta()format_schema()to handle None values: Only display Range when min/max are not NoneBenefits
Testing
🤖 Generated with Claude Code