8000 Suppress `DeprecationWarning` when updating `template.data` by emilykl · Pull Request #5080 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Suppress DeprecationWarning when updating template.data #5080

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

Merged
merged 4 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
format
  • Loading branch information
emilykl committed Mar 12, 2025
commit 2a0241d653d6080950e19295baeb551cc0c7e623
2 changes: 1 addition & 1 deletion plotly/graph_objs/layout/_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType

class Template(_BaseLayoutHierarchyType):

class Template(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core/test_graph_objs/test_graph_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

class TestBackwardsCompat(TestCase):
def test_old_class_names(self):

# these were all defined at one point, we want to maintain backwards
# compat, so we basically just create a checkpoint with this test.

Expand Down Expand Up @@ -157,6 +156,7 @@ def test_pop_invalid_prop_key_error(self):
def test_pop_invalid_prop_with_default(self):
self.assertEqual(self.layout.pop("bogus", 42), 42)


class TestDeprecationWarnings(TestCase):
def test_warn_on_deprecated_mapbox_traces(self):
# This test will fail if any of the following traces
Expand Down
2 changes: 2 additions & 0 deletions tests/test_optional/test_px/test_px.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ def test_warn_on_deprecated_mapbox_px_constructors():
else:
fig_constructor(lat=[10, 20, 30], lon=[10, 20, 30])


def test_no_warn_on_non_deprecated_px_constructors():
# This test will fail if any of the following px constructors
# emits a DeprecationWarning
Expand All @@ -434,6 +435,7 @@ def test_no_warn_on_non_deprecated_px_constructors():
else:
fig_constructor(x=[1, 2, 3], y=[1, 2, 3])


def test_no_warn_on_update_template():
# This test will fail if update_layout(template=...) emits a DeprecationWarning
fig = px.line(x=[1, 2, 3], y=[1, 2, 3])
Expand Down
0