-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] promptflow 1.11.0 raises IndexError: list index out of range #3355
Comments
Hi @marinaby , thanks for reporting, we are fixing this bug in attached PR. I'll update here once it got released. Please pin back to |
# 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 <biyi@microsoft.com> Co-authored-by: Heyi <heta@microsoft.com> Co-authored-by: Brynn Yin <biyi@microsoft.com>
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you! |
Describe the bug
When running a promptflow which calls a second promptflow as a function, we get the following error message:
IndexError: list index out of range
../..//lib/python3.9/site-packages/promptflow/_sdk/entities/_flows/base.py:239: in call
result = self.invoke(inputs=kwargs)
../..//lib/python3.9/site-packages/promptflow/_sdk/entities/_flows/dag.py:170: in invoke
return super().invoke(inputs=inputs)
../..//lib/python3.9/site-packages/promptflow/_sdk/entities/_flows/base.py:247: in invoke
result = invoker._invoke(
../..//lib/python3.9/site-packages/promptflow/core/_serving/flow_invoker.py:207: in _invoke
return self.executor.exec_line(data, run_id=run_id, allow_generator_output=self.streaming())
../..//lib/python3.9/site-packages/promptflow/executor/flow_executor.py:741: in exec_line
line_result = self._exec(
../../lib/python3.9/site-packages/promptflow/executor/flow_executor.py:1027: in _exec
output, aggregation_inputs = self._exec_inner_with_trace(
../..//lib/python3.9/site-packages/promptflow/executor/flow_executor.py:934: in _exec_inner_with_trace
self._exec_post_process(inputs, output, nodes_outputs, run_info, run_tracker, span, stream)
../..//lib/python3.9/site-packages/promptflow/executor/flow_executor.py:965: in _exec_post_process
run_tracker.update_and_persist_generator_node_runs(run_info.run_id, generator_output_nodes)
self = <promptflow._core.run_tracker.RunTracker object at 0x7fc19063ac10>
run_id = 'f5e974a5-d55f-4208-be32-502c38d1ba9e'
node_names = ['chat_with_context', 'post_process']
def update_and_persist_generator_node_runs(self, run_id: str, node_names: List[str]):
"""
Persists the node runs for nodes producing generators.
E IndexError: list index out of range
../..//lib/python3.9/site-packages/promptflow/_core/run_tracker.py:452: IndexError
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
second_flow = promptflow.load_flow(flow_path)
second_flow()
Expected behavior
The flow should succeed.
Running Information(please complete the following information):
Additional context
This issue started after upgrading promptflow to 1.11.0 version, in version 1.10.0 we didn't have this problem.
The text was updated successfully, but these errors were encountered: