Add case_sensitive parameter to groupby() filter#1465
Merged
davidism merged 1 commit intopallets:mainfrom Mar 8, 2022
Merged
Conversation
27ee085 to
7d5fb45
Compare
Member
|
Making it the default to match other comparison filters makes sense. This only makes the sort insensitive, not the group, which means you could end up with unexpected groups. But if you make the group insensitive as well, it makes the keys come out lower case. It's not clear what the keys should come out as (first seen case?) or how to accomplish that without reimplementing the underlying |
Member
|
Yeah, I'm going to make it so the first key, whatever case that is, is returned as the key in the output. |
7d5fb45 to
023bbba
Compare
Co-authored-by: Yuri Sukhov <yuri.sukhov@gmail.com>
023bbba to
e690f7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quick implementation test to add support for case-insensitive sorting inside the
groupby()filter, intended to verify the approach.Changes:
case_sensitiveparameter tosync_do_groupby().sync_do_groupby()ifcase_sensitive=FalseOpen questions:
async def do_groupby) also be changed?case_sensitiveparameter beFalsefor backwards compatibility, orTrueto align with thesort()filter behavior?Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.