Skip to content

Commit aa4fbac

Browse files
authored
Merge branch 'main' into feature/eq-return-not-implemented
2 parents bb91f85 + 5373748 commit aa4fbac

File tree

12 files changed

+8451
-2837
lines changed

12 files changed

+8451
-2837
lines changed

.github/workflows/build-doc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- doc-prod
77
pull_request:
8+
types: [opened, reopened, synchronize]
89

910
jobs:
1011
build-doc:

.github/workflows/build-package.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Build
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
6-
types: [opened, reopened]
8+
types: [opened, reopened, synchronize]
79

810
jobs:
911
plotlyjs-dev-build:

.github/workflows/check-formatting.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Check Python code formatting
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
6-
types: [opened, reopened]
8+
types: [opened, reopened, synchronize]
79

810
jobs:
911
check-code-formatting:

.github/workflows/check-js-build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
on: push
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
types: [opened, reopened]
7+
paths:
8+
- 'js/**'
9+
- 'plotly/labextension/**'
10+
211
name: Check JS build
312

413
jobs:

.github/workflows/run-percy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Run Percy
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
6-
types: [opened, reopened]
8+
types: [opened, reopened, synchronize]
79
workflow_dispatch:
810

911
jobs:

.github/workflows/run-pytest.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Test
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
6-
types: [opened, reopened]
8+
types: [opened, reopened, synchronize]
79

810
jobs:
911
test-core:
@@ -54,7 +56,7 @@ jobs:
5456
run: |
5557
uv venv
5658
source .venv/bin/activate
57-
uv sync --extra dev_optional
59+
uv sync --extra dev_optional --extra dev_pandas3
5860
python --version
5961
- name: Test core
6062
run: |
@@ -82,14 +84,22 @@ jobs:
8284
python -m pytest -x test_init/test_lazy_imports.py
8385
8486
test-optional-legacy-pandas:
85-
name: Optional tests, Pandas 1 (Python 3.9, Pandas 1.2.4)
87+
name: Optional tests (Python ${{ matrix.python-version }}, pandas ${{ matrix.pandas-version }})
8688
runs-on: ubuntu-latest
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
include:
93+
- python-version: "3.9"
94+
pandas-version: "1"
95+
- python-version: "3.11"
96+
pandas-version: "2"
8797
steps:
8898
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8999
- name: Set up Python
90100
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
91101
with:
92-
python-version: "3.9"
102+
python-version: ${{ matrix.python-version }}
93103
- name: Set up Chrome for browser tests
94104
uses: ./.github/actions/setup-chrome-for-pytest
95105
- name: Set up uv
@@ -98,8 +108,7 @@ jobs:
98108
run: |
99109
uv venv
100110
source .venv/bin/activate
101-
uv sync --extra dev_optional
102-
uv pip install pandas==1.2.4 numpy==1.26.4
111+
uv sync --extra dev_optional --extra dev_pandas${{ matrix.pandas-version }}
103112
- name: Test core
104113
run: |
105114
source .venv/bin/activate
@@ -126,7 +135,7 @@ jobs:
126135
python -m pytest -x test_init/test_lazy_imports.py
127136
128137
test-kaleido-v0:
129-
name: Optional tests (Kaleido only), Kaleido v0 (Python 3.12, Kaleido v0.2.1)
138+
name: Optional tests (Kaleido only), Kaleido v0 (Python 3.12, kaleido 0.2.1)
130139
runs-on: ubuntu-latest
131140
steps:
132141
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
6-
- The `__eq__` method for `graph_objects` classes now returns `NotImplemented` to give the other operand an opportunity to handle the comparison.
6+
7+
### Fixed
8+
- Update tests to be compatible with numpy 2.4 [[#5522](https://github.com/plotly/plotly.py/pull/5522)], with thanks to @thunze for the contribution!
9+
10+
### Updated
11+
- The `__eq__` method for `graph_objects` classes now returns `NotImplemented` to give the other operand an opportunity to handle the comparison [[#5547](https://github.com/plotly/plotly.py/pull/5547)], with thanks to @RazerM for the contribution!
712

813
## [6.7.0] - 2026-04-09
914

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,26 @@ dev = [
8383
"plotly[dev_optional]"
8484
]
8585

86+
# The following extras are intended for use in CI only
87+
dev_pandas1 = [
88+
"pandas>=1,<2",
89+
"numpy>=1,<2",
90+
"setuptools<82"
91+
]
92+
dev_pandas2 = [
93+
"pandas>=2,<3",
94+
]
95+
dev_pandas3 = [
96+
"pandas>=3;python_version>='3.11'",
97+
]
98+
8699
[tool.uv]
87100
exclude-newer = "72 hours"
101+
conflicts = [
102+
[{ extra = "dev_pandas1" }, { extra = "dev_pandas2" }],
103+
[{ extra = "dev_pandas1" }, { extra = "dev_pandas3" }],
104+
[{ extra = "dev_pandas2" }, { extra = "dev_pandas3" }],
105+
]
88106

89107
[project.scripts]
90108
plotly_get_chrome = "plotly.io._kaleido:plotly_get_chrome"

tests/test_optional/test_px/test_px.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_custom_data_scatter(backend):
3636
)
3737
for data in fig.data:
3838
assert np.all(
39-
np.in1d(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
39+
np.isin(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
4040
)
4141
# Hover and custom data, no repeated arguments
4242
fig = px.scatter(

tests/test_optional/test_px/test_px_functions.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
import plotly.express as px
2-
import plotly.graph_objects as go
3-
from numpy.testing import assert_array_equal
41
import narwhals.stable.v1 as nw
52
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
68
from polars.exceptions import InvalidOperationError
79
import pytest
810

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+
917

1018
def _compare_figures(go_trace, px_fig):
1119
"""Compare a figure created with a go trace and a figure created with
@@ -153,6 +161,11 @@ def test_sunburst_treemap_colorscales():
153161

154162

155163
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+
156169
vendors = ["A", "B", "C", "D", "E", "F", "G", "H"]
157170
sectors = [
158171
"Tech",
@@ -249,6 +262,11 @@ def test_sunburst_treemap_with_path_and_hover(backend):
249262

250263

251264
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+
252270
vendors = ["A", "B", "C", "D", "E", "F", "G", "H"]
253271
sectors = [
254272
"Tech",
@@ -307,7 +325,7 @@ def test_sunburst_treemap_with_path_color(constructor):
307325
fig = px.sunburst(
308326
df.to_native(), path=path, color="sectors", color_discrete_map=cmap
309327
)
310-
assert np.all(np.in1d(fig.data[0].marker.colors, list(cmap.values())))
328+
assert np.all(np.isin(fig.data[0].marker.colors, list(cmap.values())))
311329

312330
# Numerical column in path
313331
df = (
@@ -327,6 +345,11 @@ def test_sunburst_treemap_with_path_color(constructor):
327345

328346

329347
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+
330353
vendors = ["A", "B", "C", "D", "E", "F", "G", "H"]
331354
sectors = [
332355
"Tech",
@@ -354,6 +377,11 @@ def test_sunburst_treemap_column_parent(constructor):
354377

355378

356379
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+
357385
vendors = ["A", "B", "C", "D", None, "E", "F", "G", "H", None]
358386
sectors = [
359387
"Tech",

0 commit comments

Comments
 (0)