Skip to content
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

DeprecationWarning scattermapbox unrelated trigger #4997

Open
karrmagadgeteer2 opened this issue Jan 29, 2025 · 2 comments
Open

DeprecationWarning scattermapbox unrelated trigger #4997

karrmagadgeteer2 opened this issue Jan 29, 2025 · 2 comments

Comments

@karrmagadgeteer2
Copy link

I just tried to update to version 6.0.0 for my project openseries. Using plotly.offline.plot triggers this DeprecationWarning:

DeprecationWarning: *scattermapbox* is deprecated! Use *scattermap* instead. Learn more at: https://plotly.com/python/mapbox-to-maplibre/

However, I am not using a scattermapbox, at least as far as I know. My code is here.

I assume it is related to #4900. Raising issue in case it was not intended.

Below is the output.

venv/lib/python3.10/site-packages/plotly/offline/offline.py:581: in plot
    pio.write_html(
venv/lib/python3.10/site-packages/plotly/io/_html.py:479: in write_html
    html_str = to_html(
venv/lib/python3.10/site-packages/plotly/io/_html.py:130: in to_html
    fig_dict = validate_coerce_fig_to_dict(fig, validate)
venv/lib/python3.10/site-packages/plotly/io/_utils.py:14: in validate_coerce_fig_to_dict
    fig_dict = plotly.graph_objs.Figure(fig).to_plotly_json()
venv/lib/python3.10/site-packages/plotly/graph_objs/_figure.py:641: in __init__
    super(Figure, self).__init__(data, layout, frames, skip_invalid, **kwargs)
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:556: in __init__
    self._layout_obj = self._layout_validator.validate_coerce(
venv/lib/python3.10/site-packages/_plotly_utils/basevalidators.py:2504: in validate_coerce
    v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate)
venv/lib/python3.10/site-packages/plotly/graph_objs/_layout.py:7124: in __init__
    self["template"] = _v
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:5898: in __setitem__
    super(BaseLayoutHierarchyType, self).__setitem__(prop, value)
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:4852: in __setitem__
    self._set_compound_prop(prop, value)
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:5263: in _set_compound_prop
    val = validator.validate_coerce(val, skip_invalid=self._skip_invalid)
venv/lib/python3.10/site-packages/_plotly_utils/basevalidators.py:2797: in validate_coerce
    return super(BaseTemplateValidator, self).validate_coerce(
venv/lib/python3.10/site-packages/_plotly_utils/basevalidators.py:2504: in validate_coerce
    v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate)
venv/lib/python3.10/site-packages/plotly/graph_objs/layout/_template.py:327: in __init__
    self["data"] = _v
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:4852: in __setitem__
    self._set_compound_prop(prop, value)
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:5263: in _set_compound_prop
    val = validator.validate_coerce(val, skip_invalid=self._skip_invalid)
venv/lib/python3.10/site-packages/_plotly_utils/basevalidators.py:2504: in validate_coerce
    v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate)
venv/lib/python3.10/site-packages/plotly/graph_objs/layout/template/_data.py:1727: in __init__
    self["scattermapbox"] = _v
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:4856: in __setitem__
    self._set_array_prop(prop, value)
venv/lib/python3.10/site-packages/plotly/basedatatypes.py:5337: in _set_array_prop
    val = validator.validate_coerce(val, skip_invalid=self._skip_invalid)
venv/lib/python3.10/site-packages/_plotly_utils/basevalidators.py:2596: in validate_coerce
    res.append(self.data_class(v_el, skip_invalid=skip_invalid))
@mattpotma
Copy link

mattpotma commented Jan 29, 2025

I've got the same error, but it seems to happen only in CI using pytest.

With the following in a file, I can run the file directly without problem, but running pytest plotly_file.py, I get the deprecation warning.

import plotly.express as px

def test_figure():
    _ = px.bar(x=["A", "B", "C"], y=[5, 10, 15])


if __name__ == "__main__":
    test_figure()

And a requirements.txt to reproduce it

iniconfig==2.0.0
narwhals==1.24.1
numpy==2.2.2
packaging==24.2
pandas==2.2.3
plotly==6.0.0
pluggy==1.5.0
pytest==8.3.4
python-dateutil==2.9.0.post0
pytz==2024.2
six==1.17.0
tzdata==2025.1

@karrmagadgeteer2
Copy link
Author

karrmagadgeteer2 commented Jan 30, 2025

Same for me as for @mattpotma. I run coverage run -m pytest --verbose --capture=no locally. My dependencies as below when the warning is triggered.

Dependencies

holidays              0.65
numpy                 2.2.2 
openpyxl              3.1.5 
pandas                2.2.3 
plotly                6.0.0
pyarrow               19.0.0
pydantic              2.10.6
python-dateutil       2.9.0.post0
requests              2.32.3
scipy                 1.15.1
statsmodels           0.14.4

Dev dependencies

black                 25.1.0
coverage              7.6.10
genbadge              1.1.1 
mypy                  1.14.1
pandas-stubs          2.2.3.241126
pre-commit            4.1.0 
pytest                8.3.4
ruff                  0.9.3
types-openpyxl        3.1.5.20241225
types-python-dateutil 2.9.0.20241206
types-requests        2.32.0.20241016

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

No branches or pull requests

2 participants