Skip to content

fix: preserve empty projection in read_table#25

Merged
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:read-table-empty-projection
May 21, 2026
Merged

fix: preserve empty projection in read_table#25
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:read-table-empty-projection

Conversation

@QuakeWang
Copy link
Copy Markdown
Contributor

Problem

read_table(..., columns=[]) currently skips projection because the Python wrapper checks if columns:. This makes an explicit empty projection behave the same as columns=None, so the convenience API returns all columns instead of a zero-column table with the row count preserved.

Fix

Change the wrapper to call reader.project(columns) whenever columns is not None, preserving the existing three-state projection semantics:

  • None: read all columns
  • non-empty list: read selected columns
  • empty list: read zero columns and preserve row count

Add a regression test for read_table(..., columns=[]).

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 09908ca into apache:main May 21, 2026
5 checks passed
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.

2 participants