11use crate :: builder:: plan:: AnalyzedValueMapping ;
22use crate :: ops:: sdk:: {
3- BasicValueType , EnrichedValueType , FlowInstanceContext , OpArgSchema , OpArgsResolver ,
4- SimpleFunctionExecutor , SimpleFunctionFactoryBase , Value , make_output_type,
3+ AuthRegistry , BasicValueType , EnrichedValueType , FlowInstanceContext , OpArgSchema ,
4+ OpArgsResolver , SimpleFunctionExecutor , SimpleFunctionFactoryBase , Value , make_output_type,
55} ;
66use anyhow:: Result ;
77use serde:: de:: DeserializeOwned ;
8- use serde_json:: Value as JsonValue ;
98use std:: sync:: Arc ;
109
1110fn new_literal_op_arg_schema (
@@ -30,18 +29,20 @@ pub fn build_arg_schema(name: &str, value: Value, value_type: BasicValueType) ->
3029// This function tests a flow function by providing a spec, input argument schemas, and values.
3130pub async fn test_flow_function < S , R , F > (
3231 factory : Arc < F > ,
33- spec_json : JsonValue ,
32+ spec : S ,
3433 input_arg_schemas : Vec < OpArgSchema > ,
3534 input_arg_values : Vec < Value > ,
36- context : Arc < FlowInstanceContext > ,
3735) -> Result < Value >
3836where
3937 S : DeserializeOwned + Send + Sync + ' static ,
4038 R : Send + Sync + ' static ,
4139 F : SimpleFunctionFactoryBase < Spec = S , ResolvedArgs = R > + ?Sized ,
4240{
43- // 1. Deserialize Spec
44- let spec: S = serde_json:: from_value ( spec_json) ?;
41+ let context = Arc :: new ( FlowInstanceContext {
42+ flow_instance_name : "test_flow_function" . to_string ( ) ,
43+ auth_registry : Arc :: new ( AuthRegistry :: default ( ) ) ,
44+ py_exec_ctx : None ,
45+ } ) ;
4546
4647 // 2. Resolve Schema & Args
4748 // The caller of test_flow_function will be responsible for creating these schemas.
0 commit comments