-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Executor][Bugfix] Add skip/activate condition to node_dependencies i…
…n _is_node_ready (#312) # Description ### Bug impact: When a node has no inputs but has activate config, executor will raise `InputNotFoundFromAncestorNodeOutput `. ### Bug root cause: The skip/activate conditions of the node are not added to node dependencies when judging wether a node is ready. ### Bug fix: Add skip/activate conditions to node_dependencies in `_is_node_ready` # All Promptflow Contribution checklist: - [x] **The pull request does not introduce [breaking changes]** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).** ## General Guidelines and Best Practices - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [x] Pull request includes test coverage for the included changes.
- Loading branch information
1 parent
c1b3cb1
commit cc73084
Showing
10 changed files
with
112 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/promptflow/tests/test_configs/flows/activate_with_no_inputs/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"expected_node_count": 2, | ||
"expected_outputs":{ | ||
"text": "hello world" | ||
}, | ||
"expected_bypassed_nodes":[] | ||
} | ||
] |
24 changes: 24 additions & 0 deletions
24
src/promptflow/tests/test_configs/flows/activate_with_no_inputs/flow.dag.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
inputs: | ||
text: | ||
type: string | ||
outputs: | ||
text: | ||
type: string | ||
reference: ${node_a.output} | ||
nodes: | ||
- name: node_a | ||
type: python | ||
source: | ||
type: code | ||
path: node_a.py | ||
inputs: | ||
input1: ${inputs.text} | ||
- name: node_b | ||
type: python | ||
source: | ||
type: code | ||
path: node_b.py | ||
inputs: {} | ||
activate: | ||
when: ${node_a.output} | ||
is: hello world |
3 changes: 3 additions & 0 deletions
3
src/promptflow/tests/test_configs/flows/activate_with_no_inputs/inputs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "world" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/promptflow/tests/test_configs/flows/activate_with_no_inputs/node_a.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from promptflow import tool | ||
|
||
|
||
@tool | ||
def my_python_tool(input1: str) -> str: | ||
return 'hello ' + input1 |
7 changes: 7 additions & 0 deletions
7
src/promptflow/tests/test_configs/flows/activate_with_no_inputs/node_b.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from promptflow import tool | ||
|
||
|
||
@tool | ||
def my_python_tool(): | ||
print("Avtivate") | ||
return 'Executing...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters