diff --git a/invokeai/app/services/batch_manager_storage.py b/invokeai/app/services/batch_manager_storage.py index 05ea7f9373..6942bd2587 100644 --- a/invokeai/app/services/batch_manager_storage.py +++ b/invokeai/app/services/batch_manager_storage.py @@ -363,7 +363,10 @@ class SqliteBatchProcessStorage(BatchProcessStorageBase): graph_raw = session_dict.get("graph", "unknown") canceled = session_dict.get("canceled", 0) return BatchProcess( - batch_id=batch_id, batch=parse_raw_as(Batch, batch_raw), graph=parse_raw_as(Graph, graph_raw), canceled=canceled == 1 + batch_id=batch_id, + batch=parse_raw_as(Batch, batch_raw), + graph=parse_raw_as(Graph, graph_raw), + canceled=canceled == 1, ) def get( diff --git a/tests/nodes/test_graph_execution_state.py b/tests/nodes/test_graph_execution_state.py index 8c9a5bd19d..2a41817384 100644 --- a/tests/nodes/test_graph_execution_state.py +++ b/tests/nodes/test_graph_execution_state.py @@ -27,6 +27,7 @@ from invokeai.app.services.graph import ( import pytest import sqlite3 + @pytest.fixture def simple_graph(): g = Graph() @@ -43,9 +44,7 @@ def simple_graph(): def mock_services() -> InvocationServices: # NOTE: none of these are actually called by the test invocations db_conn = sqlite3.connect(sqlite_memory, check_same_thread=False) - graph_execution_manager = SqliteItemStorage[GraphExecutionState]( - conn=db_conn, table_name="graph_executions" - ) + graph_execution_manager = SqliteItemStorage[GraphExecutionState](conn=db_conn, table_name="graph_executions") return InvocationServices( model_manager=None, # type: ignore events=TestEventService(), diff --git a/tests/nodes/test_sqlite.py b/tests/nodes/test_sqlite.py index 5ea33674df..c9c543abf9 100644 --- a/tests/nodes/test_sqlite.py +++ b/tests/nodes/test_sqlite.py @@ -4,6 +4,7 @@ from pydantic import BaseModel, Field import pytest import sqlite3 + class TestModel(BaseModel): id: str = Field(description="ID") name: str = Field(description="Name") @@ -14,6 +15,7 @@ def db() -> SqliteItemStorage[TestModel]: db_conn = sqlite3.connect(sqlite_memory, check_same_thread=False) return SqliteItemStorage[TestModel](db_conn, "test", "id") + def test_sqlite_service_can_create_and_get(db: SqliteItemStorage[TestModel]): db.set(TestModel(id="1", name="Test")) assert db.get("1") == TestModel(id="1", name="Test")