Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Bug: Inconsistency in how fromfile and intersection and union deals with self.bitarray #32

Open
srean opened this issue May 3, 2018 · 0 comments

Comments

@srean
Copy link

srean commented May 3, 2018

Once you deserialize a serialized BloomFilter object the self.bitarray length might differ because of added padding.

https://github.com/jaybaird/python-bloomfilter/blob/master/pybloom/pybloom.py#L271

Here difference in length due to the trailing bits is ignored.

No such accounting of differing bitarray lengths are being done here https://github.com/jaybaird/python-bloomfilter/blob/master/pybloom/pybloom.py#L224 or https://github.com/jaybaird/python-bloomfilter/blob/master/pybloom/pybloom.py#L238 . Here the bitarray union and intersection will fail if the bitarray.length( ) are different. The lengths may differ because of a roundtrip through serialization deserialization, even when the capacity and error-rates are the same.

I think the correct thing to do here is to strip off the padding in fromfile to ensure that the bitarray representation is exactly the same

richard-rogers added a commit to whylabs/whylogs-bloom that referenced this issue Nov 16, 2023
* Input/output similarity using multicolumn UDF
* configurable UDF name
* whylogs bump
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant