Skip to content

Mod before truncate in shufle_group - #3201

Merged
mrocklin merged 3 commits into
dask:masterfrom
mrocklin:shuffle-tasks-fix
Feb 24, 2018
Merged

mrocklin merged 3 commits into
dask:masterfrom
mrocklin:shuffle-tasks-fix

Conversation

@mrocklin

@mrocklin mrocklin commented Feb 23, 2018 •

Copy link
Copy Markdown
Member

Fixes #2730

This caused some rows to be missed during task-based shuffles

  • Tests added / passed
  • Passes flake8 dask
  • Fully documented, including docs/source/changelog.rst for all changes
    and one of the docs/source/*-api.rst files for new API

Fixes dask#2730

This caused some rows to be missed during task-based shuffles
Comment thread dask/dataframe/shuffle.py Outdated
for x in [npartitions, k, stage]]

c = np.mod(c, npartitions).astype(typ)
c = np.mod(c, npartitions, out=c)

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.

Is this line still needed?

Comment thread dask/dataframe/shuffle.py Outdated
npartitions, k, stage = [np.array(x, dtype=np.min_scalar_type(x))[()]
for x in [npartitions, k, stage]]

c = np.mod(c, npartitions).astype(typ)

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.

Could use astype(typ, copy=False) to only copy when necessary (otherwise a copy is always made, even if the type matches).

Comment thread dask/dataframe/shuffle.py Outdated
return dict(zip(range(k), parts))
result = dict(zip(range(k), parts))

return result

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.

Unnecessary diff possibly left over from debugging?

@mrocklin

Copy link
Copy Markdown
Member Author

Thanks for the review @jcrist . Resolved.

@mrocklin
mrocklin merged commit 3ad05d6 into dask:master Feb 24, 2018
@mrocklin
mrocklin deleted the shuffle-tasks-fix branch February 24, 2018 15:03
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.

2 participants