You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When attempting to pass a list to a Python node in a PromptFlow YAML file, variable references (e.g., ${inputs.num_1}) are not interpolated correctly. Whereas the same interpolation for direct function inputs is done correctly. Instead of evaluating to actual values, the List/Dict elements are parsed as strings.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
create a flow.dag.yaml file:
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.jsoninputs:
num_1:
type: intnum_2:
type: intoutputs:
out_sum1:
type: stringreference: ${sum1.output}out_sum2:
type: stringreference: ${sum2.output}nodes:
- name: sum1description: this node is executed correctly because list elements are static at graph parse timetype: pythonsource:
type: codepath: ./fn_with_list_input.pyinputs:
list_arg:
- 1
- 2
- name: sum2description: this node is not executed correctly because list elements are treated as stringstype: pythonsource:
type: codepath: ./fn_with_list_input.pyinputs:
list_arg:
- ${inputs.num_1}
- ${inputs.num_2}
create a script for the custom tool ./fn_with_list_input.py
Expected behavior
Both nodes (sum1 and sum2) should get inputs 1 and 2 and return their sum. Node sum2 should replace values for ${inputs.num_1} and ${inputs.num_2}.
Actual behavior
Node sum1 executes as expected. Node sum2 throws an exception: (TypeError) unsupported operand type(s) for +: 'int' and 'str'
upon further inspection in tracer PF did not replace ${inputs.num_1} with its actual value and has treated it as string:
Describe the bug
When attempting to pass a list to a Python node in a PromptFlow YAML file, variable references (e.g., ${inputs.num_1}) are not interpolated correctly. Whereas the same interpolation for direct function inputs is done correctly. Instead of evaluating to actual values, the List/Dict elements are parsed as strings.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
flow.dag.yaml
file:./fn_with_list_input.py
data.jsonl
main.py
main.py
Expected behavior
Both nodes (
sum1
andsum2
) should get inputs 1 and 2 and return their sum. Nodesum2
should replace values for${inputs.num_1}
and${inputs.num_2}
.Actual behavior
Node
sum1
executes as expected. Nodesum2
throws an exception:(TypeError) unsupported operand type(s) for +: 'int' and 'str'
upon further inspection in tracer PF did not replace ${inputs.num_1} with its actual value and has treated it as string:
Screenshots
Running Information(please complete the following information):
pf -v
: 1.16.1python --version
: 3.10.15The text was updated successfully, but these errors were encountered: