@@ -100,8 +100,8 @@ async def get(self: KeyValueStoreClient) -> dict | None:
100
100
found = self ._find_or_create_client_by_id_or_name (memory_storage_client = self ._memory_storage_client , id = self ._id , name = self ._name )
101
101
102
102
if found :
103
- async with found ._file_operation_lock : # type: ignore
104
- await found ._update_timestamps (has_been_modified = False ) # type: ignore
103
+ async with found ._file_operation_lock :
104
+ await found ._update_timestamps (has_been_modified = False )
105
105
return found ._to_resource_info ()
106
106
107
107
return None
@@ -127,7 +127,7 @@ async def update(self: KeyValueStoreClient, *, name: str | None = None) -> dict:
127
127
if name is None :
128
128
return existing_store_by_id ._to_resource_info ()
129
129
130
- async with existing_store_by_id ._file_operation_lock : # type: ignore
130
+ async with existing_store_by_id ._file_operation_lock :
131
131
# Check that name is not in use already
132
132
existing_store_by_name = next (
133
133
(store for store in self ._memory_storage_client ._key_value_stores_handled if store ._name and store ._name .lower () == name .lower ()),
@@ -146,7 +146,7 @@ async def update(self: KeyValueStoreClient, *, name: str | None = None) -> dict:
146
146
await force_rename (previous_dir , existing_store_by_id ._resource_directory )
147
147
148
148
# Update timestamps
149
- await existing_store_by_id ._update_timestamps (has_been_modified = True ) # type: ignore
149
+ await existing_store_by_id ._update_timestamps (has_been_modified = True )
150
150
151
151
return existing_store_by_id ._to_resource_info ()
152
152
@@ -187,7 +187,7 @@ async def list_keys(
187
187
188
188
items = []
189
189
190
- for record in existing_store_by_id ._records .values (): # type: ignore
190
+ for record in existing_store_by_id ._records .values ():
191
191
size = len (record ['value' ])
192
192
items .append (
193
193
{
@@ -222,8 +222,8 @@ async def list_keys(
222
222
is_last_selected_item_absolutely_last = last_item_in_store == last_selected_item
223
223
next_exclusive_start_key = None if is_last_selected_item_absolutely_last else last_selected_item ['key' ]
224
224
225
- async with existing_store_by_id ._file_operation_lock : # type: ignore
226
- await existing_store_by_id ._update_timestamps (has_been_modified = False ) # type: ignore
225
+ async with existing_store_by_id ._file_operation_lock :
226
+ await existing_store_by_id ._update_timestamps (has_been_modified = False )
227
227
228
228
return {
229
229
'count' : len (items ),
@@ -247,7 +247,7 @@ async def _get_record_internal(
247
247
if existing_store_by_id is None :
248
248
raise_on_non_existing_storage (StorageTypes .KEY_VALUE_STORE , self ._id )
249
249
250
- stored_record = existing_store_by_id ._records .get (key ) # type: ignore
250
+ stored_record = existing_store_by_id ._records .get (key )
251
251
252
252
if stored_record is None :
253
253
return None
@@ -264,8 +264,8 @@ async def _get_record_internal(
264
264
except ValueError :
265
265
logger .exception ('Error parsing key-value store record' )
266
266
267
- async with existing_store_by_id ._file_operation_lock : # type: ignore
268
- await existing_store_by_id ._update_timestamps (has_been_modified = False ) # type: ignore
267
+ async with existing_store_by_id ._file_operation_lock :
268
+ await existing_store_by_id ._update_timestamps (has_been_modified = False )
269
269
270
270
return record
271
271
@@ -324,22 +324,22 @@ async def set_record(self: KeyValueStoreClient, key: str, value: Any, content_ty
324
324
if 'application/json' in content_type and not is_file_or_bytes (value ) and not isinstance (value , str ):
325
325
value = json_dumps (value ).encode ('utf-8' )
326
326
327
- async with existing_store_by_id ._file_operation_lock : # type: ignore
328
- await existing_store_by_id ._update_timestamps (has_been_modified = True ) # type: ignore
327
+ async with existing_store_by_id ._file_operation_lock :
328
+ await existing_store_by_id ._update_timestamps (has_been_modified = True )
329
329
record : KeyValueStoreRecord = {
330
330
'key' : key ,
331
331
'value' : value ,
332
332
'contentType' : content_type ,
333
333
}
334
334
335
- old_record = existing_store_by_id ._records .get (key ) # type: ignore
336
- existing_store_by_id ._records [key ] = record # type: ignore
335
+ old_record = existing_store_by_id ._records .get (key )
336
+ existing_store_by_id ._records [key ] = record
337
337
338
338
if self ._memory_storage_client ._persist_storage :
339
339
if old_record is not None and _filename_from_record (old_record ) != _filename_from_record (record ):
340
- await existing_store_by_id ._delete_persisted_record (old_record ) # type: ignore
340
+ await existing_store_by_id ._delete_persisted_record (old_record )
341
341
342
- await existing_store_by_id ._persist_record (record ) # type: ignore
342
+ await existing_store_by_id ._persist_record (record )
343
343
344
344
async def _persist_record (self : KeyValueStoreClient , record : KeyValueStoreRecord ) -> None :
345
345
store_directory = self ._resource_directory
@@ -385,14 +385,14 @@ async def delete_record(self: KeyValueStoreClient, key: str) -> None:
385
385
if existing_store_by_id is None :
386
386
raise_on_non_existing_storage (StorageTypes .KEY_VALUE_STORE , self ._id )
387
387
388
- record = existing_store_by_id ._records .get (key ) # type: ignore
388
+ record = existing_store_by_id ._records .get (key )
389
389
390
390
if record is not None :
391
- async with existing_store_by_id ._file_operation_lock : # type: ignore
392
- del existing_store_by_id ._records [key ] # type: ignore
393
- await existing_store_by_id ._update_timestamps (has_been_modified = True ) # type: ignore
391
+ async with existing_store_by_id ._file_operation_lock :
392
+ del existing_store_by_id ._records [key ]
393
+ await existing_store_by_id ._update_timestamps (has_been_modified = True )
394
394
if self ._memory_storage_client ._persist_storage :
395
- await existing_store_by_id ._delete_persisted_record (record ) # type: ignore
395
+ await existing_store_by_id ._delete_persisted_record (record )
396
396
397
397
async def _delete_persisted_record (self : KeyValueStoreClient , record : KeyValueStoreRecord ) -> None :
398
398
store_directory = self ._resource_directory
@@ -437,7 +437,7 @@ def _get_storages_dir(cls: type[KeyValueStoreClient], memory_storage_client: Mem
437
437
return memory_storage_client ._key_value_stores_directory
438
438
439
439
@classmethod
440
- def _get_storage_client_cache ( # type: ignore
440
+ def _get_storage_client_cache (
441
441
cls : type [KeyValueStoreClient ],
442
442
memory_storage_client : MemoryStorageClient ,
443
443
) -> list [KeyValueStoreClient ]:
0 commit comments