-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(python): Raise properly for slices not supported by LazyFrame
#15331
Conversation
Interesting! I need to check why the parametric tests didn't catch some of these; I think the fixes looks good, but I want to update the parametric tests such that they find these, to make sure nothing else slips through 🤔 |
@alexander-beedie Actually, I did find these cases (and also #15297) using Hypothesis. I just had to actually modify the strategy a bit. I think the problem is here: Probably because of the way Hypothesis works, this isn't really very "random", and it is one of the reasons why upgrading Hypothesis gives warnings and #14798 cannot be merged. |
42446b2
to
ca7a3ad
Compare
Adjusting the weights of the test (null probability) made it work better - it found both errors. I have a TODO to fix use of |
Yes. But as you said that wouldn't solve the actual problem either. |
Note that in this branch, the changed probabilities in |
Indeed; I need to run around the parametric code addressing usage of the standard random. |
Found a couple more slice cases that are mishandled by LazyFrame. Specifically, both cases below are not supported by LazyFrame but they currently raise incorrect exceptions/errors:
slice(None, 0, k)
, wherek < 0
slice(i, None, k)
, wherei, k < 0
Both these cases should raise a
ValueError: the given slice is not supported by lazy computation