prql
prql copied to clipboard
Allow Range start to equal Range End
Let's say you want to take the 20th row.
In the playground:
- If I do take 20 I'll get the first 20 rows, not exactly the 20th.
- If I do take 20..20 I get an error "Range end is before its start.".
- If I do take 20..21 I'll get rows 20 and 21, then if I do take 1 it will throw me an error
There are workarounds, but I think it would be a nicer API to simply say take 20..20?
This fails because Range start cannot equal Range end. Maybe we could also start to equal end in a Range?
This would be very welcome, and should be quite an easy chanhe — essentially removing that check (which I guess was added when we were thinking about doing 0-based indexing)
Thanks for the issue @florent-martineau
Fixed by @Shuozeli in #946, thank you!