Skip to content

Return to_frame columns in the requested order; accept multi-column broadcast keys - #68

Merged
smmaurer merged 2 commits into
mainfrom
fix/column-order-and-multi-column-broadcasts
Sep 16, 2026
Merged

smmaurer merged 2 commits into
mainfrom
fix/column-order-and-multi-column-broadcasts

Conversation

@smmaurer

@smmaurer smmaurer commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

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_frame built 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: broadcast with lists of column names. The docstring described cast_on/onto_on as equivalents of pandas left_on/right_on, and they are passed straight through to pandas.merge, but two spots in merge_tables assumed a single column name. A small _join_columns helper normalizes the keys to lists in both places.

  • Three new tests (77 total): requested-order behavior for both DataFrameWrapper and function tables, column_map ordering, and a two-column join through merge_tables with and without a column list.
  • Version 1.9.dev3, with two changelog entries.

…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.
@smmaurer
smmaurer merged commit fb0eaf0 into main Sep 16, 2026
7 checks passed
@smmaurer
smmaurer deleted the fix/column-order-and-multi-column-broadcasts branch September 16, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant