Skip to content

Python Type Checking Regressions in v3.7.0 #14412

@markgras

Description

@markgras

Software versions

Python version : 3.13.2 (main, Feb 5 2025, 08:05:21) [GCC 14.2.1 20250128]
IPython version : (not installed)
Tornado version : 6.4.2
NumPy version : 2.2.3
Bokeh version : 3.7.0
BokehJS static path : /home/mark/Desktop/git/bokeh/venv/lib/python3.13/site-packages/bokeh/server/static
node.js version : v23.9.0
npm version : 11.1.0
jupyter_bokeh version : (not installed)
Operating system : Linux-6.13.5-2-MANJARO-x86_64-with-glibc2.41

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

After upgrading to yesterday's bokeh v3.7.0 release, functioning code that was previously passing mypy type checking is now failing. I am using the latest version of mypy:

$ python -m mypy --version
mypy 1.15.0 (compiled: yes)

Observed behavior

Running python -m mypy bokeh_typing.py on the reproducible example provided later yields this with bokeh v3.6.3:

Success: no issues found in 1 source file

and this with bokeh v3.7.0:

bokeh_typing.py:4: error: Unexpected keyword argument "x_axis_label" for "figure"  [call-arg]
bokeh_typing.py:4: error: Unexpected keyword argument "y_axis_label" for "figure"  [call-arg]
bokeh_typing.py:4: error: Unexpected keyword argument "tools" for "figure"  [call-arg]
bokeh_typing.py:5: error: Unexpected keyword argument "bounds" for "Range1d"  [call-arg]
Found 4 errors in 1 file (checked 1 source file)

Example code

from bokeh.models import Range1d
from bokeh.plotting import figure

figure(width=800, height=200, x_axis_label="x-axis", y_axis_label="y-axis", tools="")
Range1d(0, 10, bounds="auto")

Stack traceback or browser console output

Running the above example yields no errors or logs.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions