Skip to content

Commit fcb118a

Browse files
committed
adding ignore to pyright errors within apps
1 parent e1cf2e7 commit fcb118a

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ typings/matplotlib/__init__.pyi:
7474
git clone --depth 1 https://github.com/microsoft/python-type-stubs typings/python-type-stubs
7575
mv typings/python-type-stubs/stubs/matplotlib typings/
7676
rm -rf typings/python-type-stubs
77-
typings/plotly:
78-
@echo "Creating plotly stubs"
79-
pyright --createstub plotly
80-
81-
pyright-typings: typings/appdirs typings/folium typings/uvicorn typings/seaborn typings/plotly typings/matplotlib/__init__.pyi
77+
pyright-typings: typings/appdirs typings/folium typings/uvicorn typings/seaborn typings/matplotlib/__init__.pyi
8278

8379
check: check-format check-lint check-types check-tests ## check code, style, types, and test (basic CI)
8480
check-fix: format check-lint check-types check-tests ## check and format code, style, types, and test

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import ipyleaflet as ipyl # pyright: ignore[reportMissingTypeStubs]
22
import pandas as pd
33
import plotly.express as px # pyright: ignore[reportMissingTypeStubs]
4-
from plotly.graph_objs._figure import Figure
54
from shinywidgets import render_plotly, render_widget
65

76
from shiny import reactive, render
@@ -56,9 +55,11 @@ async def _():
5655
with ui.hold() as plot_ui:
5756

5857
@render_plotly
59-
def plot() -> Figure:
58+
def plot(): # pyright: ignore[reportUnknownReturnType,reportUnknownParameterType]
6059
dat = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
61-
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+
)
6263

6364

6465
@reactive.effect

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import great_tables as gt
1818
import palmerpenguins # pyright: ignore[reportMissingTypeStubs]
1919
import polars as pl
20-
from plotly.graph_objs._figure import Figure
2120

2221
from shiny import App, Inputs, Outputs, Session, module, reactive, render, req, ui
2322
from shiny.render import CellPatch
@@ -262,22 +261,19 @@ def df_styles_fn(data: pd.DataFrame) -> list[StyleInfo]:
262261
# print(summary_data._type_hints())
263262
from shinywidgets import render_widget
264263

265-
# from shiny import reactive
266-
267264
@render_widget
268-
def country_detail_pop() -> Figure:
265+
def country_detail_pop(): # pyright: ignore[reportUnknownParameterType]
269266
import plotly.express as px
270267

271-
fig: Figure = px.line(
272-
px.data.gapminder(),
268+
# Create the figure explicitly
269+
return px.line(
270+
px.data.gapminder(), # pyright: ignore[reportUnknownVariableType,reportAttributeAccessIssue]
273271
x="year",
274272
y="lifeExp",
275273
color="country",
276274
title="Population Over Time",
277275
)
278276

279-
return fig
280-
281277
@summary_data.set_patch_fn
282278
def upgrade_patch(
283279
*,

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)