feat: date parsing, component extraction, and wizard formulas
Extend FieldProposal with chrono-based date format detection and configurable component extraction (Year, Month, Quarter). Add ConfigureDates and DefineFormulas wizard steps to ImportPipeline. build_model injects derived date categories and parses formula strings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -183,11 +183,7 @@ impl Model {
|
||||
/// When `none_cats` is empty, delegates to `evaluate`.
|
||||
/// Otherwise, uses `matching_cells` with the partial key and aggregates
|
||||
/// using the measure's agg function (default SUM).
|
||||
pub fn evaluate_aggregated(
|
||||
&self,
|
||||
key: &CellKey,
|
||||
none_cats: &[String],
|
||||
) -> Option<CellValue> {
|
||||
pub fn evaluate_aggregated(&self, key: &CellKey, none_cats: &[String]) -> Option<CellValue> {
|
||||
if none_cats.is_empty() {
|
||||
return self.evaluate(key);
|
||||
}
|
||||
@ -230,11 +226,7 @@ impl Model {
|
||||
}
|
||||
|
||||
/// Evaluate aggregated as f64, returning 0.0 for empty cells.
|
||||
pub fn evaluate_aggregated_f64(
|
||||
&self,
|
||||
key: &CellKey,
|
||||
none_cats: &[String],
|
||||
) -> f64 {
|
||||
pub fn evaluate_aggregated_f64(&self, key: &CellKey, none_cats: &[String]) -> f64 {
|
||||
self.evaluate_aggregated(key, none_cats)
|
||||
.and_then(|v| v.as_f64())
|
||||
.unwrap_or(0.0)
|
||||
@ -594,10 +586,7 @@ mod model_tests {
|
||||
let mut m = Model::new("Test");
|
||||
m.add_category("Region").unwrap();
|
||||
m.category_mut("Region").unwrap().add_item("East");
|
||||
m.set_cell(
|
||||
coord(&[("Region", "East")]),
|
||||
CellValue::Number(42.0),
|
||||
);
|
||||
m.set_cell(coord(&[("Region", "East")]), CellValue::Number(42.0));
|
||||
let key = coord(&[("Region", "East")]);
|
||||
assert_eq!(
|
||||
m.evaluate_aggregated(&key, &[]),
|
||||
|
||||
Reference in New Issue
Block a user