-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Fixed #29049 -- Added Slicing Notation to F Expressions. #16310
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
Conversation
38c2f11
to
3ed66fa
Compare
Please look at my comments regarding use of |
Hi Nick,
because None is not expected by compiler.py later and ends up not working. |
Thanks for looking @SirAbhi13. I did get that working as there were two placed that needed to be updated. I've been having a further look into this and have some reservations about the design. Going to have a little play to see if I can think how this might work better. |
I did end up getting the The tests that are failing are for mysql and maria db, because they are evaluating the queries in case insensitive mode, hence returning values in testcases where empty queryset is expected. I Will have to research on how to prevent that. |
Hi @ngnpope, were you able to have any thinking about the design proposed here? Any suggestions to move this forward get this solved? 🤔 |
Hey @SirAbhi13. I think quite some time has passed so I've lost track of where I was going with that thought. I did find a local branch with a bunch of fixes though, so I've polished that off and put up #17596 to get this over the line. Thanks for the reminder and your efforts to help push this forward. Quite the number of co-authors on this one! |
@ngnpope Glad to have helped! I think the issue with MariaDB and mysql still needs to be looked at as I mentioned in my earlier comment regarding case sensitivity (IIRC) and I wasn't able to find any solution for this. |
Supersedes PRs django#9670, django#11208, django#14731, and django#16310. This adds the following changes over the previous PRs: - Used `None` to omit `end` in `ArrayField.slice_expression()` - Handled nested slicing, e.g. `F("name")[1:][:5]` - Simplified `.resolve_expression()` - Renamed `SliceableF` to `Sliced` - Clarified some inline comments Co-authored-by: Priyansh Saxena <[email protected]> Co-authored-by: Niclas Olofsson <[email protected]> Co-authored-by: David Smith <[email protected]> Co-authored-by: Mariusz Felisiak <[email protected]> Co-authored-by: Abhinav Yadav <[email protected]>
Ticket 29049
Referenced PR: #14731
Continued the previous PR from where it was left of.
Fixed the wrong SQL query that was being generated for OuterRef.
I removed the test
test_slicing_of_f_len
because even if I was testing with sliced arrays generated through Slice Transformations, the error persisted, perhaps need to open another ticket for it?Other than that PR looks good to me.