datasketch
datasketch copied to clipboard
'MinHashLSH' object has no attribute 'delete_session'
This method already exists in Asynchronus LSH but not in MinHashLSH. MinHashLSH only has insertion session method
There is no need to delete if you use with
. See example
I want to remove multiple keys in batch, the way we are inserting using insertion_session. There is a delete_session method available on AsyncMinHashLSH but not in MinHashLSH. ```
async with lsh.delete_session(batch_size=3) as session:
fs = (session.remove(key) for key in keys_to_remove)
await asyncio.gather(*fs)`
I want to remove multiple keys in batch, the way we are inserting using insertion_session. There is a delete_session method available on AsyncMinHashLSH but not in MinHashLSH. ```
async with lsh.delete_session(batch_size=3) as session: fs = (session.remove(key) for key in keys_to_remove) await asyncio.gather(*fs)`
Oh. Sorry I misunderstood the question.
Yes currently there isn't a delete_session for MinHash LSH. This feature needs to be implemented for every type of storage. Would you be interested in taking a stab at this? Currently we support Cassandra and Redis as external storage. For in-memory MinHash LSH, I guess a session doesn't make it much faster.
Yes. It only requires for database integrated lsh. Sure i will raise a PR for this functionality