From bb5e7aefb7632d7761648aa7e26500b871e092c4 Mon Sep 17 00:00:00 2001 From: Koen Vossen Date: Wed, 12 Aug 2026 13:54:08 +0200 Subject: [PATCH] Set cache_ok=True on remaining custom TypeDecorators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PathString, RevisionStateString, OperationString, TaskStateString and IngestionJobStateString lacked cache_ok, so SQLAlchemy could not cache the compiled statement for any query touching those columns — emitting a SAWarning and recompiling on every execution (surfaced by get_dataset_summary_map, which selects revision.state). They are stateless decorators (fixed impl, no params affecting SQL), so caching is safe, matching DatasetStateString/TZDateTime. Claude-Session: https://claude.ai/code/session_01B5EfLJqoafjW1FhvkxGSmg --- ingestify/infra/store/dataset/sqlalchemy/tables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ingestify/infra/store/dataset/sqlalchemy/tables.py b/ingestify/infra/store/dataset/sqlalchemy/tables.py index 5ba9ebf..9c5d628 100644 --- a/ingestify/infra/store/dataset/sqlalchemy/tables.py +++ b/ingestify/infra/store/dataset/sqlalchemy/tables.py @@ -88,6 +88,7 @@ def process_result_value(self, value, dialect): class PathString(TypeDecorator): + cache_ok = True impl = String(255) def process_bind_param(self, value: Path, dialect): @@ -115,6 +116,7 @@ def process_result_value(self, value, dialect): class RevisionStateString(TypeDecorator): + cache_ok = True impl = String(255) def process_bind_param(self, value: RevisionState, dialect): @@ -128,6 +130,7 @@ def process_result_value(self, value, dialect): class OperationString(TypeDecorator): + cache_ok = True impl = String(255) def process_bind_param(self, value: Operation, dialect): @@ -141,6 +144,7 @@ def process_result_value(self, value, dialect): class TaskStateString(TypeDecorator): + cache_ok = True impl = String(255) def process_bind_param(self, value: TaskState, dialect): @@ -154,6 +158,7 @@ def process_result_value(self, value, dialect): class IngestionJobStateString(TypeDecorator): + cache_ok = True impl = String(255) def process_bind_param(self, value: IngestionJobState, dialect):