From 161b7cc6900ba2b501ec0679f8826aebf2d6bbd2 Mon Sep 17 00:00:00 2001 From: liaozhaorun <1300336796@qq.com> Date: Mon, 6 Apr 2026 00:19:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(factors/engine):=20=E4=BF=AE=E5=A4=8D=20Dat?= =?UTF-8?q?aRouter=20=E7=BC=93=E5=AD=98=20key=20=E7=BC=BA=E5=B0=91=20colum?= =?UTF-8?q?ns=20=E5=AF=BC=E8=87=B4=E7=9A=84=E7=BC=93=E5=AD=98=E6=B1=A1?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/factors/engine/data_router.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/factors/engine/data_router.py b/src/factors/engine/data_router.py index 178580b..df44e69 100644 --- a/src/factors/engine/data_router.py +++ b/src/factors/engine/data_router.py @@ -191,9 +191,8 @@ class DataRouter: Returns: 过滤后的 DataFrame """ - cache_key = ( - f"{spec.table}_{spec.join_type}_{start_date}_{end_date}_{stock_codes}" - ) + cols_key = ",".join(sorted(spec.columns)) if spec.columns else "*" + cache_key = f"{spec.table}_{spec.join_type}_{start_date}_{end_date}_{stock_codes}_{cols_key}" with self._lock: if cache_key in self._cache: @@ -259,7 +258,8 @@ class DataRouter: Returns: 过滤后的 DataFrame """ - cache_key = f"{table_name}_{start_date}_{end_date}_{stock_codes}" + cols_key = ",".join(sorted(columns)) if columns else "*" + cache_key = f"{table_name}_{start_date}_{end_date}_{stock_codes}_{cols_key}" with self._lock: if cache_key in self._cache: