Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix combination generator in CompoundMultiIndex #108

Merged
merged 4 commits into from
Nov 5, 2021

Conversation

eculver
Copy link
Contributor

@eculver eculver commented Oct 27, 2021

Fixes #72 and #106.

This is a continuation of #107. On top of the bug fix, I added a test to express the issue.

The bug is detailed in #72 and #106. The issue is that the traversal that is done to walk the structure doesn't preserve the path correctly so only a subset of the index would ever be generated.

Thanks to @WingGithub for the original fix in #107. We wanted to get this in without losing their contribution so I made sure to pull in their commit to my branch.

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Thanks for moving this forward! I wrote a benchmark and property test in #110. The property test found one panic when AllowMissing is true, which was fixed by a length check.

The benchmark shows 31 allocs for this test case, which seems high to me. I suspect we could reduce the allocations somehow, but probably not worth going down that path right now considering this was previous entirely broken.

Also fix a bug when the index is 0 length, found by the property test
Also cleanup the existing test a little bit by using the '\x00' literal
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.

CompoundMultiIndex::FromObject will generate only one combination
3 participants