-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix concat not respecting order of OrderedDict #25224
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
Merged
+17
−7
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c54e3fe
Fix concat not respecting order of OrderedDict
alexander-ponomaroff 073ade8
Merge conflict fix
alexander-ponomaroff d6cec5c
Fix pep8 issues
alexander-ponomaroff d4e70ef
Fix import order
alexander-ponomaroff db82b07
Checks reversed to PY36
alexander-ponomaroff f1e90ea
Merge conflict
alexander-ponomaroff 0772212
Forgot to remove PY37 from imports
alexander-ponomaroff 06d3472
Change order of expected result in test_groupby_agg_ohlc_non_first() …
alexander-ponomaroff 2aee611
Fixed accidental empty line removal
alexander-ponomaroff feb7a36
Fix test_groupby_agg_ohlc_non_first()
alexander-ponomaroff a11cfc8
Testing if this will pass tests in <3.6
alexander-ponomaroff bbe7019
Merge
alexander-ponomaroff 4f6fc06
Revert back to compat check for now
alexander-ponomaroff 48cce24
Merge master
alexander-ponomaroff 451c43b
Requested changes
alexander-ponomaroff 5e47944
Merge master
alexander-ponomaroff 262208b
Merge
alexander-ponomaroff 2fb7214
Merge
alexander-ponomaroff 154c639
Remaining small requested fixes
alexander-ponomaroff 8faccf8
Merge
alexander-ponomaroff b74dc54
Fix unwanted import error
alexander-ponomaroff 3a20a1d
Use OrderedDict in groupby/generic.py
alexander-ponomaroff 1557c21
Merge
alexander-ponomaroff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the only change in behavior is that the output order is now (consistently) the arguments passed to
.agg
?Since we did
['sum', 'ohlc']
the output order is'sum', 'open', 'high', 'low', 'close'
?If so, let's add an entry to the release notes, under the Groupby bug fix section, saying that
.agg
now respects the order of arguments when'ohlc'
is one of the aggfuncs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be rather difficult to express in a whatsnew since it's really just applicable to
_aggregate_multiple_funcs
here.Perhaps a follow up to consistently use OrderedDict's in the groupby module is in order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
_aggregate_multiple_funcs
called by just by functions likeohlc
that have multiple outputs per input? Or is it also called by.agg([funcs])
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter. So this has implications to ordering which previously would have been non-deterministic in Py35.
So I think it might make sense as a follow up to use a OrderedDict and make better guarantees about the returned column order, but don't think that should hold this one up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #25692 as follow up