Repository navigation
feat: add DataFrame.join_asof and join_asof_using - #1869
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
slachiewicz
marked this pull request as ready for review
December 6, 2026 11:11
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.
Which issue does this PR close?
Closes #1866.
Rationale for this change
An ASOF join pairs each row with the closest eligible row of another table, for example the latest price at or before each trade. DataFusion 56 added
DataFrame::join_asofandDataFrame::join_asof_using, but the PythonDataFramedid not expose them.What changes are included in this PR?
Adds two
DataFramemethods:How they behave:
match_conditionis a single<,<=,>or>=comparison, with the left table on its left side.onis optional. Without it, every right row is a candidate.join_asof_usingtakes one column name or a list. It keeps the key columns of both sides in the result, the same as upstream.The PR also adds docstring examples, tests, an "ASOF Join" section in the joins user guide, and an entry in the user-facing skill.
Open questions for review
join_asof_using.DataFrame.join(on=...)coalesces same-named keys by default, but this method returns both sides' key columns, as upstream does. Should it coalesce to matchjoin?join_asof(..., on=None, using=None)would also work.on. It is a single keyword-onlyExpr, with predicates combined by&.join_ontakes*on_exprsinstead; say if you prefer that form here.match_conditionhave no test in this PR.Are there any user-facing changes?
Yes, two new methods:
DataFrame.join_asofandDataFrame.join_asof_using. Nothing existing changes.