Skip to content

fix: handle empty Arrow tables in write conversion - #6797

Open
obielin wants to merge 1 commit into
feast-dev:masterfrom
obielin:fix/empty-arrow-table-conversion
Open

fix: handle empty Arrow tables in write conversion#6797
obielin wants to merge 1 commit into
feast-dev:masterfrom
obielin:fix/empty-arrow-table-conversion

Conversation

@obielin

@obielin obielin commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What this PR does\n\nFixes #6796.\n\n_convert_arrow_fv_to_proto and _convert_arrow_odfv_to_proto converted every pyarrow.Table by accessing table.to_batches()[0]. Zero-row Arrow tables legitimately contain no record batches, making that access raise IndexError.\n\nThe helpers now return an empty write payload before converting the table to a record batch. This preserves the natural conversion invariant: zero input rows produce zero output rows.\n\n## User-facing changes\n\nNONE\n\n## Testing\n\nAdded a regression test that passes a zero-row Arrow table to both FeatureView and OnDemandFeatureView conversion paths.\n\npython -m pytest sdk/python/tests/unit/test_utils.py -q — 14 passed.

Signed-off-by: Linda Oraegbunam <obielinda@gmail.com>
@obielin
obielin requested a review from a team as a code owner August 28, 2026 21:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ae387854e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/python/feast/utils.py
Comment on lines +434 to +435
if table.num_rows == 0:
return []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required DCO sign-off

The commit message has no Signed-off-by: trailer, so this commit does not satisfy the repository's DCO requirement and may be rejected by the DCO check. Recreate the commit with a sign-off before merging.

AGENTS.md reference: AGENTS.md:L96-L96

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.09%. Comparing base (5ad5592) to head (0ae3878).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6797   +/-   ##
=======================================
  Coverage   47.08%   47.09%           
=======================================
  Files         419      419           
  Lines       51878    51882    +4     
  Branches     7525     7527    +2     
=======================================
+ Hits        24429    24434    +5     
  Misses      25700    25700           
+ Partials     1749     1748    -1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.40% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/utils.py 78.00% <100.00%> (+0.12%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ad5592...0ae3878. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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