Skip to content

[python][ray] Fix update_by_row_id failure on empty datasets - #9217

Open
XiaoHongbo-Hope wants to merge 4 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/fix-empty-ray-row-id-update
Open

[python][ray] Fix update_by_row_id failure on empty datasets#9217
XiaoHongbo-Hope wants to merge 4 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/fix-empty-ray-row-id-update

Conversation

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

Purpose

Return a no-op result when a transformed Ray Dataset contains no rows.

Ray drops the schema of an empty shuffle input, so grouping an empty update by
_FIRST_ROW_ID currently fails with ArrowInvalid: Invalid sort key column.
This change adds an internal sentinel to preserve the shuffle schema and removes
it before writing. It does not pre-count or materialize the Dataset, so the
upstream computation is not executed twice.

Tests

  • Reproduced the failure with a real Ray Dataset filtered to zero rows.
  • Verified the update returns {"num_updated": 0} and leaves the table unchanged.
  • Ran the row-id update and shared merge regression tests.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review August 14, 2026 08:53
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python][ray] Handle empty row-id update datasets [python][ray] Fix update_by_row_id failure on empty datasets Aug 14, 2026
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.

1 participant