Skip to content

Commit 3ea6643

Browse files
authored
docs(bookmark): Remove unnecessary reactive.isolate (#2129)
1 parent 2bb6ffe commit 3ea6643

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

shiny/api-examples/bookmark_callbacks/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ async def _():
5757
@session.bookmark.on_bookmark
5858
async def _(state: BookmarkState):
5959
print("Bookmark state:", state.input, state.values, state.dir)
60-
with reactive.isolate():
61-
state.values["lowercase"] = lowercase_letter()
60+
state.values["lowercase"] = lowercase_letter()
6261

6362
# After saving state, we will update the query string with the bookmark URL.
6463
@session.bookmark.on_bookmarked

shiny/bookmark/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ def server(input: Inputs, output: Outputs, session: Session):
325325
# Store custom values before bookmarking
326326
@session.bookmark.on_bookmark
327327
async def _(state: BookmarkState):
328-
with reactive.isolate():
329-
state.values["lowercase"] = lowercase_letter()
328+
state.values["lowercase"] = lowercase_letter()
330329

331330
# Update URL after bookmarking
332331
@session.bookmark.on_bookmarked

shiny/plotutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def near_points(
310310
if all_rows:
311311
# Add selected_ column if needed
312312
new_df["selected_"] = False
313-
new_df.iloc[ # pyright: ignore[reportArgumentType]
313+
new_df.iloc[ # pyright: ignore[reportArgumentType,reportCallIssue]
314314
keep_idx,
315315
new_df.columns.get_loc( # pyright: ignore[reportUnknownMemberType]
316316
"selected_"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
df.loc[:, "Sample Number"] = df.loc[
4545
:, "Sample Number"
4646
].apply( # pyright: ignore[reportCallIssue]
47-
lambda x: ui.HTML( # pyright: ignore[reportUnknownLambdaType]
47+
lambda x: ui.HTML( # pyright: ignore[reportUnknownLambdaType,reportUnknownArgumentType]
4848
str(
4949
ui.tags.strong(
5050
ui.tags.em(str(x)) # pyright: ignore[reportUnknownArgumentType]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def random_generator():
5050
pd_penguins["Island"] = pd_penguins[
5151
"Island"
5252
].apply( # pyright: ignore[reportUnknownMemberType]
53-
lambda z: ui.TagList( # pyright: ignore[reportUnknownLambdaType]
53+
lambda z: ui.TagList( # pyright: ignore[reportUnknownLambdaType,reportUnknownArgumentType]
5454
ui.input_checkbox(f"checkbox_{z}_{random_generator()}", f"{z}"),
5555
ui.tags.img(
5656
src="https://dka575ofm4ao0.cloudfront.net/pages-transactional_logos/retina/276517/posit-logo-fullcolor-TM.png",
@@ -62,10 +62,10 @@ def random_generator():
6262
# Set the first value of the column to an html object.
6363
# Narwhals does not inspect the types beyond the first row.
6464
# Theforefore, we should not either and need to set the type to object.
65-
pd_penguins.iloc[0, 5] = ui.div( # pyright: ignore[reportArgumentType]
65+
pd_penguins.iloc[0, 5] = ui.div( # pyright: ignore[reportArgumentType,reportCallIssue]
6666
pd_penguins.iloc[0, 5] # pyright: ignore[reportArgumentType]
6767
)
68-
pd_penguins.iloc[1, 5] = ui.p( # pyright: ignore[reportArgumentType]
68+
pd_penguins.iloc[1, 5] = ui.p( # pyright: ignore[reportArgumentType,reportCallIssue]
6969
ui.input_action_button("pandas_test_cell_button", "Test button"),
7070
ui.output_text_verbatim("pandas_test_cell_text", placeholder=True),
7171
)

0 commit comments

Comments
 (0)