Skip to content

[BUG] DeprecationWarning: Update dash/_jupyter.py to use comm module instead of deprecated ipykernel.comm.Comm #3416

@R3myG

Description

@R3myG

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

dash 3.2.0
dash-bootstrap-components 2.0.4
django-plotly-dash 2.5.0

  • OS: macOS (Darwin 24.6.0)
  • Python: 3.12
  • Environment: Testing/Development with pytest

Describe the bug

Dash's Jupyter integration (dash/_jupyter.py) is using the deprecated ipykernel.comm.Comm class, which generates deprecation warnings during test runs and when importing Dash in Jupyter environments.

Warning output:

/path/to/.venv/lib/python3.12/site-packages/dash/_jupyter.py:30: DeprecationWarning:

The ipykernel.comm.Comm class has been deprecated. Please use the comm module instead.
For creating comms, use the function from comm import create_comm.

Root cause:

  • Line 25: from ipykernel.comm import Comm
  • Line 30: _dash_comm = Comm(target_name="dash")

Expected behavior

No deprecation warnings should appear when using Dash. The code should use the modern comm module API instead of the deprecated ipykernel.comm.Comm.

Proposed fix:

# Replace line 25:
from comm import create_comm

# Replace line 30:
_dash_comm = create_comm(target_name="dash")

This is a non-breaking change that would clean up test output and ensure future compatibility with newer ipykernel versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokeninfrastructurebuild process etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions