twosigma / twosigma/marbles

assertUnique might break for collections that are not integer-indexable

Open
#74 1 comment 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Python
Stars
155
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Description

Since we use slice indexing, I think `assertUnique` will fail on collections which are not integer-indexable. Sets have this property, but sets already enforce uniqueness so that's not a real problem. [multisets](https://pypi.org/project/multiset/) may expose a problem here though?

Contributor guide

Open the contributing guide

Research direction

Start by locating the assertUnique entry point and reviewing how it uses slice indexing. Reproduce the reported behavior with a non-integer-indexable collection such as the linked multisets package, then add a regression test if the failure is confirmed and verify the existing uniqueness checks still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.