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

Complete program execution on exceptions in async_mode=True #231

Merged
merged 4 commits into from
Jun 20, 2023

Conversation

jprafael
Copy link
Contributor

Fixes and adds unit test for #206. Uses the proposed implementation with extra stuff to clean-up tasks after completion.

task.cancel()
loop.run_until_complete(asyncio.sleep(0)) # give the loop a chance to cancel the tasks

# TODO: do we really want to close the loop? what if it is used by others?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slundberg is it possible that the loop is shared with other usages and that this loop.close() should not be called (and be the caller's resposability to do that?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point.

@jprafael
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Realm"

@slundberg
Copy link
Contributor

Thanks! Will dig into this soon.

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2023

Codecov Report

Merging #231 (a46582d) into main (4651387) will decrease coverage by 0.11%.
The diff coverage is 68.96%.

@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
- Coverage   67.74%   67.63%   -0.11%     
==========================================
  Files          54       54              
  Lines        2970     2985      +15     
==========================================
+ Hits         2012     2019       +7     
- Misses        958      966       +8     
Impacted Files Coverage Δ
guidance/_program.py 56.61% <68.96%> (-0.42%) ⬇️

@slundberg
Copy link
Contributor

Thank you again for this PR @jprafael ! It looks good to me, and I am merging now.

@slundberg slundberg merged commit e3c6fe9 into guidance-ai:main Jun 20, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants