Skip to content

merge_asof(..., left_on='col', right_index=True) issue #6183 - #6192

Merged
jcrist merged 3 commits into
dask:masterfrom
noreentry:master
May 15, 2020
Merged

jcrist merged 3 commits into
dask:masterfrom
noreentry:master

Conversation

@noreentry

Copy link
Copy Markdown
Contributor

#6183

  • Tests added / passed
  • Passes black dask / flake8 dask

Comment thread dask/dataframe/methods.py Resolved
Comment thread dask/dataframe/multi.py Resolved
Comment thread dask/dataframe/tests/test_multi.py Resolved
Comment thread dask/dataframe/multi.py Resolved
Comment thread dask/dataframe/multi.py Resolved
@jcrist

jcrist commented May 11, 2020

Copy link
Copy Markdown
Member

Thanks for the PR, this is looking pretty good! Just a few small changes needed.

@noreentry

noreentry commented May 13, 2020 •

Copy link
Copy Markdown
Contributor Author

i've found some problems in multi.py::pair_partitions():

dd.merge_asof(dd.from_pandas(pd.DataFrame({'a':[10,20,30]}, index=[10,20,30]), npartitions=1),
              pd.DataFrame({'b':[1,2,3]}, index=[1,2,3]), 
              left_index=True, right_index=True).compute()

raises

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/noreentry/miniconda3/envs/py38forge/lib/python3.8/site-packages/dask/dataframe/multi.py", line 867, in merge_asof
    result = merge_asof_indexed(left, right, **kwargs)
  File "/home/noreentry/miniconda3/envs/py38forge/lib/python3.8/site-packages/dask/dataframe/multi.py", line 773, in merge_asof_indexed
    for i, J in enumerate(pair_partitions(left.divisions, right.divisions)):
  File "/home/noreentry/miniconda3/envs/py38forge/lib/python3.8/site-packages/dask/dataframe/multi.py", line 674, in pair_partitions
    while R[j + 1] <= L[i]:
IndexError: tuple index out of range

fixed

@noreentry
noreentry requested a review from jcrist May 14, 2020 12:25
@noreentry noreentry changed the title fixing merge_asof(..., left_on='col', right_index=True) issue #6183 merge_asof(..., left_on='col', right_index=True) issue #6183 May 14, 2020

@jcrist jcrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good to me, just one small fix and I'm happy to merge. Thanks for working through this @noreentry!

Comment thread dask/dataframe/multi.py Resolved
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.

3 participants