eino icon indicating copy to clipboard operation
eino copied to clipboard

feat: workflow supports mapping from nested fields and to nested fields

Open shentongmartin opened this issue 9 months ago • 1 comments

What type of PR is this?

feat: workflow supports mapping from nested fields and to nested fields

  1. can create field mapping from fields of nested structs or nested maps
  2. can create field mapping to fields of nested structs or nested maps
  3. use the same API to create nested field mapping, use '.' to join field paths
  4. allow an intermediate level of the mapping 'source' to be an interface, will defer type check to request time:

e.g.

// the output of from_node_key is map[string]any.
// at request time, the value for key 'field1' is another map with a key 'field2'
// when Compiling the workflow, we only know the value type of the map is 'any'.
// So we will defer type checking to request time.
AddInput("from_node_key", FromField("field1.field2")

shentongmartin avatar Mar 07 '25 02:03 shentongmartin

📊 Coverage Report:

File coverage threshold (20%) satisfied:	PASS
Package coverage threshold (30%) satisfied:	PASS
Total coverage threshold (83%) satisfied:	PASS
Total test coverage: 83.7% (3442/4110)

github-actions[bot] avatar Mar 07 '25 02:03 github-actions[bot]