Skip to content

Unit tests added to assist in tracking down issue #6640: Dask Bag Groupby hashing problem - #6648

Closed
lazarillo wants to merge 5 commits into
dask:masterfrom
lazarillo:master
Closed

lazarillo wants to merge 5 commits into
dask:masterfrom
lazarillo:master

Conversation

@lazarillo

Copy link
Copy Markdown
  • Tests added / passed

Tests added:

  • test_bag_groupby_pure_hash: groupby works fine with keys where the hash of the key == the key. This test just validates that this is currently correct.

  • test_bag_groupby_normal_hash: groupby is currently failing when the hash of the key != the key. This test highlights that issue. It does not yet fix the issue, just captures it in a unit test.

  • Passes black dask / flake8 dask

Yes, I ran black dask (well, I have black-format-on-save within VS Code).

@jsignell jsignell 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.

I have some suggestions for how to simplify, but thanks for writing these up! To make both tests pass you can run it with PYTHONHASHSEED set:

env PYTHONHASHSEED=42 pytest -k test_bag_groupby

Comment thread dask/bag/tests/test_bag.py Resolved
Comment thread dask/bag/tests/test_bag.py Resolved
@jsignell

Copy link
Copy Markdown
Member

Ok thanks @lazarillo! I am happy with the new tests. I am not quite sure we want so many TODO comments in the bag code, but they don't really hurt. It could be a nice exercise for someone to go through and write tests for all of them.

@jsignell

Copy link
Copy Markdown
Member

Closing in favor of #6660

@jsignell jsignell closed this Sep 23, 2020
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