fix: handle empty Arrow tables in write conversion - #6797
Conversation
Signed-off-by: Linda Oraegbunam <obielinda@gmail.com>
There was a problem hiding this comment.
💡 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".
| if table.num_rows == 0: | ||
| return [] |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
What this PR does\n\nFixes #6796.\n\n
_convert_arrow_fv_to_protoand_convert_arrow_odfv_to_protoconverted everypyarrow.Tableby accessingtable.to_batches()[0]. Zero-row Arrow tables legitimately contain no record batches, making that access raiseIndexError.\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.