From 73ccb56a5363fdcf3503cd77660834d23bb2a86a Mon Sep 17 00:00:00 2001 From: Pawel Date: Sat, 7 Dec 2024 18:56:46 -0800 Subject: [PATCH 1/2] Fix bug for running single flow nodes with inner dict inputs Inputs like ${parent_node.output.result.inner_key} will fail because of how the inputs are currently written to the jsonl inputs file. Eg. {"parent_node.output.result.inner_key":{"result":{"inner_key1":"foo","inner_key2":"bar"},"metrics":{"mertric_1":1.2}} This is different behavior than when running entire flow where the input is always keyed on "parent_node.output.result" rather than "parent_node.output.result.inner_key". --- .../promptflow/executor/_input_assignment_parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/promptflow-core/promptflow/executor/_input_assignment_parser.py b/src/promptflow-core/promptflow/executor/_input_assignment_parser.py index 0657682ff95..f4989edfc28 100644 --- a/src/promptflow-core/promptflow/executor/_input_assignment_parser.py +++ b/src/promptflow-core/promptflow/executor/_input_assignment_parser.py @@ -69,6 +69,8 @@ def parse_value(i: InputAssignment, nodes_outputs: dict, flow_inputs: dict): def parse_node_property(node_name, node_val, property=""): val = node_val + if "." in property and property in val.keys(): + val= val[property] property_parts = re.findall(property_pattern, property) try: for part in property_parts: From 4f0dcbb0d625a74a6efd3a467c20119b35480365 Mon Sep 17 00:00:00 2001 From: Pawel Date: Sat, 7 Dec 2024 19:02:05 -0800 Subject: [PATCH 2/2] Fix flake8 error add whitespace around operator --- .../promptflow/executor/_input_assignment_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/promptflow-core/promptflow/executor/_input_assignment_parser.py b/src/promptflow-core/promptflow/executor/_input_assignment_parser.py index f4989edfc28..070e5f0519d 100644 --- a/src/promptflow-core/promptflow/executor/_input_assignment_parser.py +++ b/src/promptflow-core/promptflow/executor/_input_assignment_parser.py @@ -70,7 +70,7 @@ def parse_value(i: InputAssignment, nodes_outputs: dict, flow_inputs: dict): def parse_node_property(node_name, node_val, property=""): val = node_val if "." in property and property in val.keys(): - val= val[property] + val = val[property] property_parts = re.findall(property_pattern, property) try: for part in property_parts: