Skip to content

Unable to set prepickle to False on using Redis storage layer in LSH #273

@Varun0157

Description

@Varun0157

This (potential) bug was discovered while working on writing integration tests for the Redis storage.

On using the Redis storage, setting prepickle to False seems to have no real effect. Based on the documentation, a default value should be chosen based on the storage_config only if prepickle is not specified, not if it is falsy.

A reproduction is as below:

dict_config = {'type': 'dict'}
lsh_dict = MinHashLSH(threshold=0.5, num_perm=16, storage_config=dict_config, prepickle=False)
print(f"Dict storage with prepickle=False: lsh.prepickle = {lsh_dict.prepickle}") # prints: False

redis_config = {'type': 'redis', 'redis': {'host': '127.0.0.1', 'port': 6379}}
lsh_redis = MinHashLSH(threshold=0.5, num_perm=16, storage_config=redis_config, prepickle=False)
print(f"Redis storage with prepickle=False: lsh.prepickle = {lsh_redis.prepickle}") # prints: True

If this is intended behaviour, the documentation should perhaps be updated accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions