Skip to content

Conversation

@brandonschabell
Copy link
Contributor

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

  • I have broken down my PR scope into the following TODO tasks
    • task 1
    • task 2
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Copilot AI review requested due to automatic review settings December 16, 2025 16:39
Copy link

Copilot AI left a 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() with inspect.iscoroutinefunction()
  • Add inspect module imports where needed
  • Remove unused asyncio import from dash/_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):
Copy link

Copilot AI Dec 16, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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 😄

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

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

💃

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

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

💃

@T4rk1n T4rk1n merged commit f7bb866 into plotly:dev Dec 18, 2025
8 of 10 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.

2 participants