-
-
Notifications
You must be signed in to change notification settings - Fork 748
Use asyncio.iscoroutinefunction
#4771
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
Conversation
As `inspect.iscoroutinefunction` doesn't work on Cythonized `async` functions, use `asyncio.iscoroutinefunction` instead. Internally it already calls `inspect.iscoroutinefunction` as part of the check it performs. So there is no need to do this in addition to `inspect.iscoroutinefunction` as that is already handled.
|
James, do you recall if there were particular tests affected by this? |
|
I think most (if not all) of the tests we |
|
Thanks for checking James 🙂 Good point. Missed that. Asked upstream if we could backport that PR to 0.29 Would it make sense to add this anyways? Or should we hold off? |
|
Thanks for asking for a backport -- that would be great. I'm slightly inclined to hold off for now just so we can keep this PR around as a reminder to remove the relevant |
|
Yep sounds reasonable to me. Will go ahead and mark it as a draft then |
asyncio.iscoroutinefunctionasyncio.iscoroutinefunction
|
@jakirkham https://github.com/cython/cython/blob/master/CHANGES.rst#features-added-18 Maybe of interest:
I haven't really looked into this too much so if you have unanswered questions then the cython-users mailing list may be more helpful than me. I think the monkey-patching applies if you import |
asyncio.iscoroutinefunctionasyncio.iscoroutinefunction
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 15 files ±0 15 suites ±0 6h 30m 21s ⏱️ + 25m 58s Results for commit 50a1d40. ± Comparison against base commit 058e629. ♻️ This comment has been updated with latest results. |
As
inspect.iscoroutinefunctiondoesn't work on Cythonizedasyncfunctions, useasyncio.iscoroutinefunctioninstead. Internally it already callsinspect.iscoroutinefunctionas part of the check it performs. So there is no need to do this in addition toinspect.iscoroutinefunctionas that is already handled.TODO: Re-enable Cythonized Scheduler tests fixed by this (in particular the ones in
test_failed_workers) as noted belowxref: #4764 (comment)
cc @jrbourbeau
black distributed/flake8 distributed/isort distributed