From a4f892dcfb9e37e001cac8bf35e2a6476811f9b5 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:09:18 +1100 Subject: [PATCH] tidy(nodes): remove unused `get_raw` method on ItemStorageABC --- .../app/services/item_storage/item_storage_base.py | 7 +------ .../services/item_storage/item_storage_sqlite.py | 13 ------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/invokeai/app/services/item_storage/item_storage_base.py b/invokeai/app/services/item_storage/item_storage_base.py index e94c049ee4..8f6f7315a3 100644 --- a/invokeai/app/services/item_storage/item_storage_base.py +++ b/invokeai/app/services/item_storage/item_storage_base.py @@ -1,5 +1,5 @@ from abc import ABC, abstractmethod -from typing import Callable, Generic, Optional, TypeVar +from typing import Callable, Generic, TypeVar from pydantic import BaseModel @@ -25,11 +25,6 @@ class ItemStorageABC(ABC, Generic[T]): """Gets the item, parsing it into a Pydantic model""" pass - @abstractmethod - def get_raw(self, item_id: str) -> Optional[str]: - """Gets the raw item as a string, skipping Pydantic parsing""" - pass - @abstractmethod def set(self, item: T) -> None: """Sets the item""" diff --git a/invokeai/app/services/item_storage/item_storage_sqlite.py b/invokeai/app/services/item_storage/item_storage_sqlite.py index e02d3bdbb2..c49d91f3c0 100644 --- a/invokeai/app/services/item_storage/item_storage_sqlite.py +++ b/invokeai/app/services/item_storage/item_storage_sqlite.py @@ -81,19 +81,6 @@ class SqliteItemStorage(ItemStorageABC, Generic[T]): return self._parse_item(result[0]) - def get_raw(self, id: str) -> Optional[str]: - try: - self._lock.acquire() - self._cursor.execute(f"""SELECT item FROM {self._table_name} WHERE id = ?;""", (str(id),)) - result = self._cursor.fetchone() - finally: - self._lock.release() - - if not result: - return None - - return result[0] - def delete(self, id: str): try: self._lock.acquire()