|
1 | | -import plotly.express as px |
2 | | -import plotly.graph_objects as go |
3 | | -from numpy.testing import assert_array_equal |
4 | 1 | import narwhals.stable.v1 as nw |
5 | 2 | import numpy as np |
| 3 | +from numpy.testing import assert_array_equal |
| 4 | +from packaging.version import Version |
| 5 | +import pandas |
| 6 | +import plotly.express as px |
| 7 | +import plotly.graph_objects as go |
6 | 8 | from polars.exceptions import InvalidOperationError |
7 | 9 | import pytest |
8 | 10 |
|
| 11 | +from .conftest import pandas_pyarrow_constructor |
| 12 | + |
| 13 | + |
| 14 | +def _pandas_version_at_least(version: str) -> bool: |
| 15 | + return Version(pandas.__version__) >= Version(version) |
| 16 | + |
9 | 17 |
|
10 | 18 | def _compare_figures(go_trace, px_fig): |
11 | 19 | """Compare a figure created with a go trace and a figure created with |
@@ -153,6 +161,11 @@ def test_sunburst_treemap_colorscales(): |
153 | 161 |
|
154 | 162 |
|
155 | 163 | def test_sunburst_treemap_with_path(constructor): |
| 164 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 165 | + pytest.skip( |
| 166 | + "known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)" |
| 167 | + ) |
| 168 | + |
156 | 169 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
157 | 170 | sectors = [ |
158 | 171 | "Tech", |
@@ -249,6 +262,11 @@ def test_sunburst_treemap_with_path_and_hover(backend): |
249 | 262 |
|
250 | 263 |
|
251 | 264 | def test_sunburst_treemap_with_path_color(constructor): |
| 265 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 266 | + pytest.skip( |
| 267 | + "known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)" |
| 268 | + ) |
| 269 | + |
252 | 270 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
253 | 271 | sectors = [ |
254 | 272 | "Tech", |
@@ -327,6 +345,11 @@ def test_sunburst_treemap_with_path_color(constructor): |
327 | 345 |
|
328 | 346 |
|
329 | 347 | def test_sunburst_treemap_column_parent(constructor): |
| 348 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 349 | + pytest.skip( |
| 350 | + "known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)" |
| 351 | + ) |
| 352 | + |
330 | 353 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
331 | 354 | sectors = [ |
332 | 355 | "Tech", |
@@ -354,6 +377,11 @@ def test_sunburst_treemap_column_parent(constructor): |
354 | 377 |
|
355 | 378 |
|
356 | 379 | def test_sunburst_treemap_with_path_non_rectangular(constructor): |
| 380 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 381 | + pytest.skip( |
| 382 | + "known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)" |
| 383 | + ) |
| 384 | + |
357 | 385 | vendors = ["A", "B", "C", "D", None, "E", "F", "G", "H", None] |
358 | 386 | sectors = [ |
359 | 387 | "Tech", |
|
0 commit comments