From 0867655d85496c6da5b5178cd7d3e5ee661ef2a8 Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 26 Aug 2026 05:08:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E6=96=87=E6=9C=AC=E5=9B=A0?= =?UTF-8?q?=E5=AD=90=E8=AF=BB=E5=8F=96=E4=B8=B4=E6=97=B6=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/data.rs | 7 +++++++ crates/fidc-core/src/platform_expr_strategy.rs | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/fidc-core/src/data.rs b/crates/fidc-core/src/data.rs index b3f815d..c4f3e94 100644 --- a/crates/fidc-core/src/data.rs +++ b/crates/fidc-core/src/data.rs @@ -2449,6 +2449,13 @@ impl DataSet { .unwrap_or_default() } + pub fn factor_text_rows_on(&self, date: NaiveDate) -> &[FactorTextValue] { + self.factor_text_by_date + .get(&date) + .map(Vec::as_slice) + .unwrap_or(&[]) + } + pub fn market_snapshots_on(&self, date: NaiveDate) -> Vec<&DailyMarketSnapshot> { self.market_by_date .get(&date) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index 5624451..bbf87bc 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -3687,8 +3687,8 @@ impl PlatformExprStrategy { }, available_text_factor_names: if self.stock_text_factors_required { ctx.data - .factor_text_snapshots_on(date) - .into_iter() + .factor_text_rows_on(date) + .iter() .map(|row| row.field.clone()) .collect() } else { @@ -4081,8 +4081,8 @@ impl PlatformExprStrategy { extra_factors, extra_text_factors: if self.stock_text_factors_required { ctx.data - .factor_text_snapshots_on(date) - .into_iter() + .factor_text_rows_on(date) + .iter() .filter(|row| row.symbol == symbol) .map(|row| (row.field.clone(), row.value.clone())) .collect()