Repository navigation
Commit b1618e0
authored
### Rationale for this change
When filtering a RecordBatch using an expression that results in zero matching rows, an IndexError was raised due to an attempt to access the first batch of an empty result. This change ensures that such cases are handled gracefully by returning an empty RecordBatch with the correct schema.
### What changes are included in this PR?
Fixed a bug in _filter_table where filtering all rows from a RecordBatch would raise an IndexError.
Added a helper function _empty_record_batch_from_schema to construct an empty RecordBatch with the correct schema.
### Are these changes tested?
Yes, the behavior was verified manually. Let me know if you'd like a dedicated test case added to the test suite.
### Are there any user-facing changes?
No changes to public APIs. The fix ensures more robust handling of edge cases internally.
- Github issue: #44366
* GitHub Issue: #44366
Authored-by: Koen Vossen <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 577fa89 commit b1618e0
2 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
379 | 383 | | |
380 | 384 | | |
381 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1418 | 1429 | | |
1419 | 1430 | | |
1420 | 1431 | | |
| |||
1434 | 1445 | | |
1435 | 1446 | | |
1436 | 1447 | | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
1437 | 1459 | | |
1438 | 1460 | | |
1439 | 1461 | | |
| |||
0 commit comments