-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Replace deprecated asyncio.iscoroutinefunction() call with inspect.iscoroutinefunction() #3545
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
Replace deprecated asyncio.iscoroutinefunction() call with inspect.iscoroutinefunction() #3545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses a deprecation warning by replacing asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() across the codebase. The asyncio version is deprecated as of Python 3.14 and will be removed in Python 3.16.
Key changes:
- Replace all instances of
asyncio.iscoroutinefunction()withinspect.iscoroutinefunction() - Add
inspectmodule imports where needed - Remove unused
asyncioimport fromdash/_callback.py
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dash/dash.py | Added inspect import; replaced two instances of asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() |
| dash/background_callback/managers/diskcache_manager.py | Added inspect import; replaced asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() |
| dash/background_callback/managers/celery_manager.py | Added inspect import; replaced asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() |
| dash/_jupyter.py | Replaced asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() (import likely exists elsewhere in file) |
| dash/_callback.py | Added inspect import; replaced two instances of asyncio.iscoroutinefunction() with inspect.iscoroutinefunction(); removed unused asyncio import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| break | ||
|
|
||
| if asyncio.iscoroutinefunction(kernel.do_one_iteration): | ||
| if inspect.iscoroutinefunction(kernel.do_one_iteration): |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inspect module is not imported in this file. Add import inspect at the top of the file to avoid a NameError at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's imported on line 3 😄
T4rk1n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
…coroutinefunction()
e79e2df to
a9a173f
Compare
T4rk1n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
The
asyncio.iscoutinefunction()function is deprecated and will be removed in python 3.16. This begins raising deprecation warnings in python 3.14. This PR cleans that all up.Contributor Checklist
optionals
CHANGELOG.md