Skip to content

fix(query): restore typed column descriptors - #56

Merged
leonkenneth merged 3 commits into
mainfrom
fix/query-column-types
Oct 12, 2026
Merged

leonkenneth merged 3 commits into
mainfrom
fix/query-column-types

Conversation

@leonkenneth

@leonkenneth leonkenneth commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

0.8.0 reduced QueryResult#columns / query_all[:columns] to bare names, dropping column types. This restores typed column descriptors.

  • Columns are ColumnDescriptors, a Data class with #name and #type readers. They are immutable and compare by value. column["name"] no longer works.
  • Rows stay keyed by column name.
  • A malformed column line now raises ParseError. Only name and type are kept.
  • Requires Ruby 3.2 because Data was added in 3.2. The gemspec and RuboCop now target 3.2, which matches the CI matrix (3.0 and 3.1 are end-of-life). This also applies RuboCop's anonymous argument forwarding fixes (&, **) in the adapters and client.
  • Fix duplicate .returns in the query_all RBI sig.
  • Bump specs submodule.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leonkenneth
leonkenneth requested review from redox and utay October 12, 2026 09:24
Comment thread lib/altertable/lakehouse/client.rb Outdated
raise column_parse_error("expected a { \"name\", \"type\" } column object, got #{column.inspect}")
end

ColumnDescriptor["name" => name, "type" => type]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wouldn't even inherit from Hash it it's to only use it like this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes I was afraid of silent re-serialization breaking, but it's probably overkill to be backward compatible for this

leonkenneth and others added 2 commits October 12, 2026 13:52
CI only tests Ruby 3.2+, and 3.0/3.1 are end-of-life. Raise the
gemspec and RuboCop floor to match, and apply the anonymous argument
forwarding RuboCop now asks for.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drop the Hash subclass and its string-key access; Data provides
value equality, hash, to_h and immutability.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leonkenneth
leonkenneth merged commit 46a92b5 into main Oct 12, 2026
10 checks passed
@leonkenneth
leonkenneth deleted the fix/query-column-types branch October 12, 2026 11:54
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.

3 participants