datasketch icon indicating copy to clipboard operation
datasketch copied to clipboard

'MinHashLSH' object has no attribute 'delete_session'

Open Priyabrata409 opened this issue 3 years ago • 4 comments

This method already exists in Asynchronus LSH but not in MinHashLSH. MinHashLSH only has insertion session method

Priyabrata409 avatar Feb 03 '22 05:02 Priyabrata409

There is no need to delete if you use with. See example

ekzhu avatar Feb 04 '22 08:02 ekzhu

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)` 

Priyabrata409 avatar Feb 04 '22 09:02 Priyabrata409

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.

ekzhu avatar Feb 11 '22 08:02 ekzhu

Yes. It only requires for database integrated lsh. Sure i will raise a PR for this functionality

Priyabrata409 avatar Feb 11 '22 08:02 Priyabrata409