Skip to content
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

[Executor][Bugfix] Adjust flow traces logic to make sure error is correctly raised #2076

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

thy09
Copy link
Contributor

@thy09 thy09 commented Feb 22, 2024

Description

Currently flow level trace is always "Success" since we wrapped it in wrong place.
Update such code to make sure the error is correctly caught in the span.

This pull request includes significant changes to the FlowExecutor class in the src/promptflow/promptflow/executor/flow_executor.py file. The primary changes involve refactoring the _exec_with_trace method and its usages throughout the class. The method has been split into two separate methods: _exec_inner_with_trace and _exec_inner. The functions _exec, exec_line, _exec_in_thread, and exec have been updated to use these new methods. The changes aim to improve the readability and maintainability of the code.

Updates to method usages:

  • The exec method now calls _exec instead of _exec_with_trace.
  • The _exec_in_thread method now calls _exec instead of _exec_with_trace.
  • The exec_line method now calls _exec instead of _exec_with_trace.
  • The _exec method now calls _exec_inner_with_trace instead of containing the logic that was moved to _exec_inner.

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.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: 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.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@thy09 thy09 requested a review from a team as a code owner February 22, 2024 05:30
@github-actions github-actions bot added promptflow executor The changes related to the execution of the flow labels Feb 22, 2024
Copy link

github-actions bot commented Feb 22, 2024

SDK CLI Global Config Test Result heta/failure-trace

2 tests   2 ✅  46s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 71a024e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 22, 2024

promptflow SDK CLI Azure E2E Test Result heta/failure-trace

  4 files    4 suites   3m 22s ⏱️
148 tests 127 ✅ 21 💤 0 ❌
592 runs  508 ✅ 84 💤 0 ❌

Results for commit 71a024e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 22, 2024

Executor Unit Test Result heta/failure-trace

733 tests   733 ✅  45s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 71a024e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 22, 2024

Executor E2E Test Result heta/failure-trace

197 tests   195 ✅  4m 11s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit 71a024e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 22, 2024

SDK CLI Test Result heta/failure-trace

   12 files     12 suites   43m 42s ⏱️
  424 tests   408 ✅ 16 💤 0 ❌
1 696 runs  1 632 ✅ 64 💤 0 ❌

Results for commit 71a024e.

♻️ This comment has been updated with latest results.

@thy09 thy09 merged commit ff975f3 into main Feb 23, 2024
42 checks passed
@thy09 thy09 deleted the heta/failure-trace branch February 23, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
executor The changes related to the execution of the flow promptflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants