Skip to content

Commit 9908d72

Browse files
committed
add deprecation warnings to px mapbox functions
1 parent cb3dba7 commit 9908d72

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Diff for: packages/python/plotly/plotly/express/_chart_types.py

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from warnings import warn
2+
13
from ._core import make_figure
24
from ._doc import make_docstring
35
import plotly.graph_objs as go
@@ -1415,9 +1417,18 @@ def scatter_mapbox(
14151417
height=None,
14161418
) -> go.Figure:
14171419
"""
1420+
*scatter_mapbox* is deprecated! Use *scatter_map* instead.
1421+
Learn more at: https://plotly.com/python/mapbox-to-maplibre/
14181422
In a Mapbox scatter plot, each row of `data_frame` is represented by a
14191423
symbol mark on a Mapbox map.
14201424
"""
1425+
warn(
1426+
"*scatter_mapbox* is deprecated!"
1427+
+ " Use *scatter_map* instead."
1428+
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
1429+
stacklevel=2,
1430+
category=DeprecationWarning,
1431+
)
14211432
return make_figure(args=locals(), constructor=go.Scattermapbox)
14221433

14231434

@@ -1453,9 +1464,18 @@ def choropleth_mapbox(
14531464
height=None,
14541465
) -> go.Figure:
14551466
"""
1467+
*choropleth_mapbox* is deprecated! Use *choropleth_map* instead.
1468+
Learn more at: https://plotly.com/python/mapbox-to-maplibre/
14561469
In a Mapbox choropleth map, each row of `data_frame` is represented by a
14571470
colored region on a Mapbox map.
14581471
"""
1472+
warn(
1473+
"*choropleth_mapbox* is deprecated!"
1474+
+ " Use *choropleth_map* instead."
1475+
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
1476+
stacklevel=2,
1477+
category=DeprecationWarning,
1478+
)
14591479
return make_figure(args=locals(), constructor=go.Choroplethmapbox)
14601480

14611481

@@ -1489,9 +1509,18 @@ def density_mapbox(
14891509
height=None,
14901510
) -> go.Figure:
14911511
"""
1512+
*density_mapbox* is deprecated! Use *density_map* instead.
1513+
Learn more at: https://plotly.com/python/mapbox-to-maplibre/
14921514
In a Mapbox density map, each row of `data_frame` contributes to the intensity of
14931515
the color of the region around the corresponding point on the map
14941516
"""
1517+
warn(
1518+
"*density_mapbox* is deprecated!"
1519+
+ " Use *density_map* instead."
1520+
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
1521+
stacklevel=2,
1522+
category=DeprecationWarning,
1523+
)
14951524
return make_figure(
14961525
args=locals(), constructor=go.Densitymapbox, trace_patch=dict(radius=radius)
14971526
)
@@ -1526,9 +1555,18 @@ def line_mapbox(
15261555
height=None,
15271556
) -> go.Figure:
15281557
"""
1558+
*line_mapbox* is deprecated! Use *line_map* instead.
1559+
Learn more at: https://plotly.com/python/mapbox-to-maplibre/
15291560
In a Mapbox line plot, each row of `data_frame` is represented as
15301561
a vertex of a polyline mark on a Mapbox map.
15311562
"""
1563+
warn(
1564+
"*line_mapbox* is deprecated!"
1565+
+ " Use *line_map* instead."
1566+
+ " Learn more at: https://plotly.com/python/mapbox-to-maplibre/",
1567+
stacklevel=2,
1568+
category=DeprecationWarning,
1569+
)
15321570
return make_figure(args=locals(), constructor=go.Scattermapbox)
15331571

15341572

0 commit comments

Comments
 (0)