Return to_frame columns in the requested order; accept multi-column broadcast keys - #68
Merged
Merged
Conversation
…roadcast keys DataFrameWrapper.to_frame(columns) built its column selections from sets, so registered columns came back in an order that varied from call to call (#57). Keep the requested order instead, dropping duplicates, and reorder the result so local and registered columns appear as requested. column_map likewise resolves columns in the order given, so merge_tables output is predictable too. broadcast documented cast_on and onto_on as equivalents of pandas left_on and right_on, but merge_tables assumed a single column name and failed with lists (#37). Normalize the keys to lists where merge_tables collects join columns and excludes them from the overlap check, and document that lists are accepted. Bump the version to 1.9.dev3 and add changelog entries.
…ng the frame, avoiding a copy on pandas 2
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two small fixes to long-standing issues, folded into the 1.9 release ahead of the release candidate.
Issue #57: inconsistent column order from
to_frame(columns).DataFrameWrapper.to_framebuilt its column selections from sets, so local columns came back in the order requested but registered (computed) columns came back in an order that varied from call to call. It now keeps the requested order. Otherwise the behavior is unchanged.Issue #37:
broadcastwith lists of column names. The docstring describedcast_on/onto_onas equivalents of pandasleft_on/right_on, and they are passed straight through topandas.merge, but two spots inmerge_tablesassumed a single column name. A small_join_columnshelper normalizes the keys to lists in both places.DataFrameWrapperand function tables,column_mapordering, and a two-column join throughmerge_tableswith and without a column list.1.9.dev3, with two changelog entries.