Skip to content

Commit 47dd27d

Browse files
authored
fix(typing): add pyright: ignore to plotly functions within apps (#2001)
1 parent 0e0f186 commit 47dd27d

File tree

3 files changed

+10
-9
lines changed
  • tests/playwright/shiny/components

3 files changed

+10
-9
lines changed

tests/playwright/shiny/components/chat/shiny_output/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ async def _():
5555
with ui.hold() as plot_ui:
5656

5757
@render_plotly
58-
def plot():
58+
def plot(): # pyright: ignore[reportUnknownReturnType,reportUnknownParameterType]
5959
dat = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
60-
return px.scatter(dat, x="x", y="y") # pyright: ignore[reportUnknownMemberType]
60+
return px.scatter( # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
61+
dat, x="x", y="y"
62+
)
6163

6264

6365
@reactive.effect

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,13 @@ def df_styles_fn(data: pd.DataFrame) -> list[StyleInfo]:
261261
# print(summary_data._type_hints())
262262
from shinywidgets import render_widget
263263

264-
# from shiny import reactive
265-
266264
@render_widget
267-
def country_detail_pop():
265+
def country_detail_pop(): # pyright: ignore[reportUnknownParameterType]
268266
import plotly.express as px
269267

268+
# Create the figure explicitly
270269
return px.line(
271-
px.data.gapminder(),
270+
px.data.gapminder(), # pyright: ignore[reportUnknownVariableType,reportAttributeAccessIssue]
272271
x="year",
273272
y="lifeExp",
274273
color="country",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def random_generator():
3333
)
3434
)
3535

36-
studyName = (
37-
pd_penguins["studyName"] # pyright: ignore[reportUnknownVariableType]
36+
studyName = ( # pyright: ignore[reportUnknownVariableType]
37+
pd_penguins["studyName"]
3838
.copy()
39-
.astype("object")
39+
.astype("object") # pyright: ignore[reportUnknownMemberType]
4040
)
4141
# Set the first value of the column to an html object so the column is treated as object by narwhals (not str)
4242
studyName[0] = htmlDep

0 commit comments

Comments
 (0)