Skip to content

Rename bag.concat to bag.flatten#2402

Merged
mrocklin merged 2 commits intodask:masterfrom
mrocklin:bag-flatten
Jun 2, 2017
Merged

Rename bag.concat to bag.flatten#2402
mrocklin merged 2 commits intodask:masterfrom
mrocklin:bag-flatten

Conversation

@mrocklin
Copy link
Copy Markdown
Member

@mrocklin mrocklin commented Jun 1, 2017

Concat is the name we use from toolz. However flatten may be more clear.
Additionally db.concat does something totally different.

Concat is the name we use from toolz.  However flatten may be more clear.
Additionally db.concat does something totally different.
dask/bag/core.py Outdated
for i in range(self.npartitions))
return type(self)(merge(self.dask, dsk), name, self.npartitions)

concat = flatten
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.

Should probably deprecate the old name.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

b = db.from_sequence([1, 2, 3]).map(lambda x: x * [1, 2, 3])
assert list(b.concat()) == [1, 2, 3] * sum([1, 2, 3])

def test_flatten():
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.

Any reason to keep the above concat tests around?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, that concat operates entirely differently and remains valid.

@mrocklin
Copy link
Copy Markdown
Member Author

mrocklin commented Jun 1, 2017

Merging soon if no further comments

@mrocklin mrocklin merged commit 5d45d55 into dask:master Jun 2, 2017
@mrocklin mrocklin deleted the bag-flatten branch June 2, 2017 12:20
@sinhrks sinhrks added this to the 0.15.0 milestone Aug 30, 2017
mauhai added a commit to mauhai/dask that referenced this pull request Oct 11, 2017
i am updating the docs according to dask#2402
@mauhai mauhai mentioned this pull request Oct 11, 2017
3 tasks
jcrist pushed a commit that referenced this pull request Oct 11, 2017
i am updating the docs according to #2402
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