Fetch only value in get_object (#17320)

Fetch only value in get_object.
This commit is contained in:
Amine Khaldi
2024-01-12 15:15:40 -06:00
committed by GitHub
parent d677140632
commit c93e7ae672
+2 -2
View File
@@ -29,14 +29,14 @@ class KeyValStore:
"""
async with self.db_wrapper.reader_no_transaction() as conn:
cursor = await conn.execute("SELECT * from key_val_store WHERE key=?", (key,))
cursor = await conn.execute("SELECT value from key_val_store WHERE key=?", (key,))
row = await cursor.fetchone()
await cursor.close()
if row is None:
return None
return object_type.from_bytes(row[1])
return object_type.from_bytes(row[0])
async def set_object(self, key: str, obj: Any):
"""