max() on empty LazyFrame returned by scan_delta() causes PanicException #19890
Labels
accepted
Ready for implementation
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
When I create a new delta table via Databricks with the following SQL:
And when I then try to get the max timestamp via Polars:
I get a
PanicException
When I then insert one record via:
And try it again, it works fine.
Also, when I try to do this on an entirely fresh LazyFrame (not created via
scan_delta
) it seems to work fine:So probably it is related to how scan_delta() creates a LazyFrame? In code I could check for records first as a workaround, however the PanicException seems not like desired behavior to me.
Log output
Issue description
Aggregation (at least
max()
but probably it is the same for other aggregation functions) on top of an empty LazyFrame returned fromscan_delta()
throws a PanicException.Expected behavior
I would expect to return an empty DataFrame, just like the 2nd example where I created my own LazyFrame instead of throwing a PanicException. Want to check first if this is indeed a bug and not desired functionality, most likely it is specific to
scan_delta()
.Installed versions
The text was updated successfully, but these errors were encountered: