BUG: LazyFrame neglects head(0) if a sort follows #15779
Labels
A-optimizer
Area: plan optimization
accepted
Ready for implementation
bug
Something isn't working
P-high
Priority: high
python
Related to Python Polars
Checks
Reproducible example
I'm very sorry that I did not arrive at a small reproducible example, I really tried.
See https://github.com/lorentzenchr/model-diagnostics/blob/615b131892c6ddf81b0fbdf331daf5beb8601843/src/model_diagnostics/calibration/tests/test_identification.py#L502 for a test that fails with
model-diagnostics==1.1.0
andpolars>=0.20.20
(also tested with 0.20.21).The lines causing this are:
https://github.com/lorentzenchr/model-diagnostics/blob/615b131892c6ddf81b0fbdf331daf5beb8601843/src/model_diagnostics/calibration/identification.py#L468-L469
Log output
No response
Issue description
A
df.head(0)
should always produce a dataframe with zero rows and some columns. As of polars 0.20.20, aLazyFrame
neglects thehead(0)
if followed bysort(..)
, at least in certain (harder to reproduce) circumstances.The fix for model-diagnostics was lorentzenchr/model-diagnostics#148.
Expected behavior
Return a dataframe with 0 rows.
Installed versions
The text was updated successfully, but these errors were encountered: