Skip to main content

Module tidy_dispatch

Module tidy_dispatch 

Source
Expand description

Shared tidy dispatch: maps CJC language method calls on TidyView / GroupedTidyView values to the concrete cjc_data API.

Both cjc-eval and cjc-mir-exec call into dispatch_tidy_method and dispatch_grouped_method so that every tidy operation has a single source of truth. The executors only need to pattern-match Value::TidyView or Value::GroupedTidyView and delegate here.

§Error handling

All errors are returned as Err(String). The caller wraps the string into its own error type (EvalError / MirExecError).

Functions§

build_arrange_key
Build an ArrangeKey struct value.
build_binop_expr
Build a DExpr binary operation.
build_col_expr
Build a Value::Struct { name: "DExpr", kind: "col", ... } from a column name.
build_tidy_agg
Build a TidyAgg struct value.
dataframe_to_value
Convert a DataFrame to the legacy Value::Struct { name: "DataFrame" } representation used by existing CJC code.
dispatch_grouped_method
Dispatch a method call on a Value::GroupedTidyView.
dispatch_tidy_builtin
Dispatch builder builtins like col(), desc(), asc(), sum(), mean(), etc. Returns Ok(Some(value)) if recognised, Ok(None) otherwise.
dispatch_tidy_method
Dispatch a method call on a Value::TidyView.
value_to_dexpr
Parse a Value::Struct { name: "DExpr", ... } into a DExpr.
wrap_grouped
Wrap a GroupedTidyView into Value::GroupedTidyView.
wrap_view
Wrap a TidyView into Value::TidyView.