fix: ParseJSONDataComponent prevent unnecessary array wrapping (#4357)
* fix(ParseJSONDataComponent): prevent unnecessary array wrapping Prevent wrapping non-array inputs in arrays to ensure correct JSON parsing and filtering. * [autofix.ci] apply automated fixes * updated failing test --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
a107650cc6
commit
19963ded26
2 changed files with 22 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ async def test_from_message():
|
|||
ParseJSONDataComponent,
|
||||
inputs={
|
||||
"input_value": ComponentInputHandle(clazz=ChatInput, inputs={}, output_name="message"),
|
||||
"query": ".[0].key",
|
||||
"query": ".key",
|
||||
},
|
||||
run_input="{'key':'value1'}",
|
||||
)
|
||||
|
|
@ -47,7 +47,7 @@ async def test_from_message():
|
|||
ParseJSONDataComponent,
|
||||
inputs={
|
||||
"input_value": ComponentInputHandle(clazz=ChatInput, inputs={}, output_name="message"),
|
||||
"query": ".[0].key.[0].field2",
|
||||
"query": ".key.[0].field2",
|
||||
},
|
||||
run_input='{"key":[{"field1": 1, "field2": 2}]}',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue