Skip to content

Commit 5f7bb34

Browse files
committed
test polars
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 91fd0de commit 5f7bb34

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/python/plotly/plotly/tests/test_optional/test_px/test_px_input.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,16 @@ def __dataframe__(self):
273273
version.parse(pd.__version__) < version.parse("2.0.2"),
274274
reason="plotly doesn't use a dataframe interchange protocol for pandas < 2.0.2",
275275
)
276-
def test_build_df_from_vaex():
277-
import vaex
276+
@pytest.mark.parametrize("test_lib", ["vaex", "polars"])
277+
def test_build_df_from_vaex_and_polars(test_lib):
278+
if test_lib == "vaex":
279+
import vaex as lib
280+
else:
281+
import polars as lib
278282

279283
# take out the 'species' columns since the vaex implementation does not cover strings yet
280284
iris_pandas = px.data.iris()[["petal_width", "sepal_length"]]
281-
iris_vaex = vaex.from_pandas(iris_pandas)
285+
iris_vaex = lib.from_pandas(iris_pandas)
282286
args = dict(data_frame=iris_vaex, x="petal_width", y="sepal_length")
283287
out = build_dataframe(args, go.Scatter)
284288
assert_frame_equal(

packages/python/plotly/test_requirements/requirements_39_pandas_2_optional.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ scikit-image==0.18.1
2020
psutil==5.7.0
2121
kaleido
2222
vaex
23+
polars

0 commit comments

Comments
 (0)