Skip to content

Commit aedd67a

Browse files
committed
add a test that should fail since px doesn't support pandas 2
1 parent 3eb3ee4 commit aedd67a

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Diff for: .circleci/config.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,21 @@ commands:
9292
cd packages/python/plotly
9393
. venv/bin/activate
9494
pytest -x test_init/test_lazy_imports.py
95-
95+
- run:
96+
name: Test PX if Pandas 2
97+
command: |
98+
if [ "<<parameters.py>>" == "39_pandas_2" ]; then
99+
. packages/python/plotly/venv/bin/activate
100+
pip install -e ./packages/python/plotly
101+
pip install -e ./packages/python/plotly-geo
102+
python test/percy/plotly-express.py
103+
mkdir test/percy/pandas2
104+
mv test/percy/*.html test/percy/pandas2/
105+
# 1.1 is the earliest minor with Py3.9 wheels
106+
pip install "pandas==1.1.5"
107+
python test/percy/plotly-express.py
108+
python test/percy/compare-pandas.py
109+
fi
96110
test_orca:
97111
parameters:
98112
py:

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ packages/python/plotly/jupyterlab_plotly/labextension/
5454
packages/python/plotly/jupyterlab_plotly/nbextension/index.js*
5555

5656
test/percy/*.html
57+
test/percy/pandas2/*.html

Diff for: test/percy/compare-pandas.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
3+
os.chdir(os.path.dirname(__file__))
4+
5+
for filename in os.listdir("pandas2"):
6+
with open(filename, encoding="utf-8") as f:
7+
with open(os.path.join("pandas2", filename)) as f2:
8+
assert f.read() == f2.read(), f"Pandas 1/2 difference in {filename}"

0 commit comments

Comments
 (0)