Skip to content

Commit eae8fab

Browse files
committed
Remove the headache of modin
1 parent 4d52c45 commit eae8fab

File tree

5 files changed

+7
-88
lines changed

5 files changed

+7
-88
lines changed

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ test = [
8787
"faicons",
8888
"ridgeplot",
8989
"great_tables",
90-
# modin depends on ray, which doesn't support Python 3.13
91-
"modin[all];python_version<'3.13'",
92-
# ray doesn't currently support Python 3.13
93-
"ray;python_version<'3.13'",
9490
"polars",
9591
"dask[dataframe]",
9692
"pyarrow",

tests/playwright/shiny/components/data_frame/data_type/app.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
from __future__ import annotations
22

3-
import sys
4-
5-
# Remove this conditional once modin is supported on Python 3.13
6-
if sys.version_info < (3, 13):
7-
import modin.pandas as mpd # pyright: ignore[reportMissingTypeStubs]
8-
else:
9-
raise RuntimeError("This test is not supported on Python 3.13")
10-
113
import narwhals.stable.v1 as nw
124
import palmerpenguins # pyright: ignore[reportMissingTypeStubs]
135
import polars as pl
@@ -19,7 +11,6 @@
1911

2012
nw_df = nw.from_native(pd_df, eager_only=True)
2113
pa_df = pa.table(pd_df) # pyright: ignore[reportUnknownMemberType]
22-
mpd_df = mpd.DataFrame(pd_df)
2314
pl_df = pl.DataFrame(pd_df)
2415

2516

@@ -145,46 +136,6 @@ def pa_data_view():
145136
def pa_data_view_selected():
146137
return str(type(pa_df_original.data_view(selected=True)))
147138

148-
with ui.card():
149-
ui.h2("Modin Data")
150-
151-
@render.data_frame
152-
def mpd_df_original():
153-
return render.DataGrid(
154-
data=mpd_df,
155-
selection_mode="row",
156-
)
157-
158-
"Selected row:"
159-
160-
@render.data_frame
161-
def selected_mpd_row():
162-
return mpd_df_original.data_view(selected=True)
163-
164-
"Data type:"
165-
166-
@render.code
167-
def mpd_type():
168-
return str(type(mpd_df))
169-
170-
ui.markdown("`.data()` type:")
171-
172-
@render.code
173-
def mpd_data():
174-
return str(type(mpd_df_original.data()))
175-
176-
ui.markdown("`.data_view()` type:")
177-
178-
@render.code
179-
def mpd_data_view():
180-
return str(type(mpd_df_original.data_view()))
181-
182-
ui.markdown("`.data_view(selected=True)` type:")
183-
184-
@render.code
185-
def mpd_data_view_selected():
186-
return str(type(mpd_df_original.data_view(selected=True)))
187-
188139
with ui.card():
189140
ui.h2("Polars Data")
190141

tests/playwright/shiny/components/data_frame/data_type/test_df_data_type.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import re
2-
import sys
32

4-
import pytest
53
from playwright.sync_api import Page
64

75
from shiny.playwright import controller
@@ -32,19 +30,9 @@
3230
"df_original": "pl_df_original",
3331
"selected_row": "selected_pl_row",
3432
},
35-
{
36-
"name": "modin",
37-
"prefix": "mpd",
38-
"df_original": "mpd_df_original",
39-
"selected_row": "selected_mpd_row",
40-
},
4133
]
4234

4335

44-
@pytest.mark.skipif(
45-
sys.version_info[:2] == (3, 13),
46-
reason="Skipping on Python 3.13, since modin is not supported on 3.13",
47-
)
4836
def test_data_frame_data_type(
4937
page: Page,
5038
local_app: ShinyAppProc,
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
from __future__ import annotations
22

3-
import sys
4-
5-
# Remove this conditional once modin is supported on Python 3.13
6-
if sys.version_info < (3, 13):
7-
import modin.pandas as md # pyright: ignore[reportMissingTypeStubs]
8-
else:
9-
# This block executes for Python 3.13 and above
10-
raise RuntimeError("This test is not supported on Python 3.13")
113
import narwhals.stable.v1 as nw
124
import palmerpenguins # pyright: ignore[reportMissingTypeStubs]
135

@@ -17,8 +9,6 @@
179

1810
nw_df = nw.from_native(pd_df, eager_only=True)
1911

20-
md_df = md.DataFrame(pd_df)
21-
2212
with ui.card():
2313

2414
ui.h2("Polars Pandas Data")
@@ -36,14 +26,14 @@ def nw_df_type():
3626

3727
with ui.card():
3828

39-
ui.h2("Modin dataframe Data")
29+
ui.h2("Pandas dataframe Data")
4030

4131
@render.table
42-
def md_table():
43-
return md_df
32+
def pd_table():
33+
return pd_df
4434

4535
"Data type:"
4636

4737
@render.code
48-
def md_df_type():
49-
return str(type(md_df))
38+
def pd_df_type():
39+
return str(type(pd_df))
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
import re
2-
import sys
32

4-
import pytest
53
from playwright.sync_api import Page
64

75
from shiny.playwright import controller
86
from shiny.run import ShinyAppProc
97

108

11-
@pytest.mark.skipif(
12-
sys.version_info >= (3, 13),
13-
reason="Skipping on Python 3.13 and above, since modin is not supported on these versions",
14-
)
159
def test_table_data_support(page: Page, local_app: ShinyAppProc) -> None:
1610
page.goto(local_app.url)
1711

1812
controller.OutputTable(page, "nw_table").expect_nrow(2)
1913
controller.OutputCode(page, "nw_df_type").expect_value(re.compile("narwhals"))
2014

21-
controller.OutputTable(page, "md_table").expect_nrow(2)
22-
controller.OutputCode(page, "md_df_type").expect_value(re.compile("modin"))
15+
controller.OutputTable(page, "pd_table").expect_nrow(2)
16+
controller.OutputCode(page, "pd_df_type").expect_value(re.compile("pandas"))

0 commit comments

Comments
 (0)