Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Fix the bug that generator in subflow would fail. (#3357)
# Description Bugfix for #3355 This pull request includes a significant change in the `update_and_persist_generator_node_runs` method in the `src/promptflow-core/promptflow/_core/run_tracker.py` file. The change primarily focuses on adding a condition to check if `api_calls` for a `node_run_info` exists before proceeding with the update. This change is important as it takes into account scenarios where `api_calls` for the node run might not exist, such as in a flow as function/serving. In such cases, the update is skipped. Additionally, the method of accessing the `output` from `api_calls` has been changed from direct indexing to using the `get` method, which is a safer way to access dictionary values. * [`src/promptflow-core/promptflow/_core/run_tracker.py`](diffhunk://#diff-a5027d19a24cb28a68ead16dfe6c54492c78d6e0e7640e80533928808cdb3422R451-R457): Added a condition to check if `api_calls` exists for `node_run_info` before updating it. This accounts for scenarios where `api_calls` for the node run might not exist. Also, changed the way `output` is accessed from `api_calls` by using the `get` method instead of direct indexing. # All Promptflow Contribution checklist: - [ ] **The pull request does not introduce [breaking changes].** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [ ] Title of the pull request is clear and informative. - [ ] 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 - [ ] Pull request includes test coverage for the included changes. --------- Signed-off-by: Brynn Yin <[email protected]> Co-authored-by: Heyi <[email protected]> Co-authored-by: Brynn Yin <[email protected]>
- Loading branch information