|
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,9 @@ 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("known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)") |
| 166 | + |
156 | 167 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
157 | 168 | sectors = [ |
158 | 169 | "Tech", |
@@ -249,6 +260,9 @@ def test_sunburst_treemap_with_path_and_hover(backend): |
249 | 260 |
|
250 | 261 |
|
251 | 262 | def test_sunburst_treemap_with_path_color(constructor): |
| 263 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 264 | + pytest.skip("known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)") |
| 265 | + |
252 | 266 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
253 | 267 | sectors = [ |
254 | 268 | "Tech", |
@@ -327,6 +341,9 @@ def test_sunburst_treemap_with_path_color(constructor): |
327 | 341 |
|
328 | 342 |
|
329 | 343 | def test_sunburst_treemap_column_parent(constructor): |
| 344 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 345 | + pytest.skip("known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)") |
| 346 | + |
330 | 347 | vendors = ["A", "B", "C", "D", "E", "F", "G", "H"] |
331 | 348 | sectors = [ |
332 | 349 | "Tech", |
@@ -354,6 +371,9 @@ def test_sunburst_treemap_column_parent(constructor): |
354 | 371 |
|
355 | 372 |
|
356 | 373 | def test_sunburst_treemap_with_path_non_rectangular(constructor): |
| 374 | + if _pandas_version_at_least("3.0.0") and constructor == pandas_pyarrow_constructor: |
| 375 | + pytest.skip("known issue with pandas 3 + pandas_pyarrow_constructor + px.sunburst() (https://github.com/plotly/plotly.py/issues/5571)") |
| 376 | + |
357 | 377 | vendors = ["A", "B", "C", "D", None, "E", "F", "G", "H", None] |
358 | 378 | sectors = [ |
359 | 379 | "Tech", |
|
0 commit comments