plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

add deprecation notice for mapbox traces

Open archmoj opened this issue 1 year ago • 2 comments

Closes #4730.

archmoj avatar Oct 07 '24 18:10 archmoj

These show up when you are using the new traces

image

Also, it looks like they are removed when we run the commands to update Plotly.js. Those classes are probably autogenerated

LiamConnors avatar Oct 08 '24 13:10 LiamConnors

cc @archmoj

gvwilson avatar Oct 08 '24 13:10 gvwilson

could we use a warning as mentioned by @ndrezn above https://github.com/plotly/plotly.py/pull/4783#discussion_r1791936053

LiamConnors avatar Nov 06 '24 21:11 LiamConnors

could we use a warning as mentioned by @ndrezn above #4783 (comment)

I am not sure is that's a good idea. My concern is that it could be too annoying for users and it may be considered a notable undesirable change.

archmoj avatar Nov 06 '24 22:11 archmoj

could we use a warning as mentioned by @ndrezn above #4783 (comment)

I am not sure is that's a good idea. My concern is that it could be too annoying for users and it may be considered a notable undesirable change.

@archmoj Being annoying is the whole point, so that users will change their code before the traces are removed entirely.

emilykl avatar Nov 06 '24 22:11 emilykl

@LiamConnors Could you please test this to see if this produce the desirable warnings? Thank you!

archmoj avatar Nov 07 '24 16:11 archmoj

@archmoj, I see the deprecation notice on traces and px functions that don't use mapbox

import plotly.express as px
df = px.data.gapminder().query("year == 2007")
fig = px.line_geo(df, locations="iso_alpha",
                  color="continent", # "continent" is one of the columns of gapminder
                  projection="orthographic")
fig.show()
image image

But not on ones that do:

image

LiamConnors avatar Nov 07 '24 17:11 LiamConnors

@archmoj Maybe you're already on it but I think the warning needs to go inside the __init__ function rather than at the top of the class to fix the issue Liam is seeing.

emilykl avatar Nov 07 '24 17:11 emilykl

@archmoj Maybe you're already on it but I think the warning needs to go inside the __init__ function rather than at the top of the class to fix the issue Liam is seeing.

@LiamConnors Thanks for catching that. Let's try @emilykl's suggestion.

archmoj avatar Nov 07 '24 17:11 archmoj

@archmoj, I still see the issue

image

LiamConnors avatar Nov 11 '24 19:11 LiamConnors

@LiamConnors Debugging the bug you noticed wasn't easy. I figured the error is coming from the plotly.py templates which include defaults for "scattermapbox" traces as well as `"mapbox" subplots. On the other hand resolving the merge conflicts of this PR is not easy. So I close this PR; then open a new PR. Thank you!

archmoj avatar Nov 13 '24 19:11 archmoj