Skip to content

Commit c3fbd6b

Browse files
committed
Merge followup
1 parent a3f4605 commit c3fbd6b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

shiny/express/_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def module(
2323

2424
@functools.wraps(fn)
2525
def wrapper(id: Id, *args: P.args, **kwargs: P.kwargs) -> R:
26-
parent_session = require_active_session(None)
26+
parent_session = require_active_session()
2727
module_session = parent_session.make_scope(id)
2828

2929
with session_context(module_session):

shiny/render/_data_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ def _set_output_metadata(self, *, output_id: str) -> None:
764764
# from creating a renderer in one module and registering it on an output with a
765765
# different session.
766766

767-
active_session = require_active_session(None)
767+
active_session = require_active_session()
768768
if self._get_session() != active_session:
769769
raise RuntimeError(
770770
"The session used when creating the renderer "

shiny/render/_data_frame_utils/_datagridtable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def serialize_pandas_df(df: "pd.DataFrame") -> dict[str, Any]:
335335

336336
with pd.option_context("mode.copy_on_write", True):
337337
df = df.copy(deep=False)
338-
session = require_active_session(None)
338+
session = require_active_session()
339339

340340
def wrap_shiny_html_with_session(x: TagNode):
341341
return wrap_shiny_html(x, session=session)

shiny/ui/_input_dark_mode.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
from .._docstring import add_example, no_example
1010
from .._namespaces import resolve_id
11-
from ..session import Session, require_active_session
11+
from ..session import require_active_session
12+
from ..types import MISSING, MISSING_TYPE
1213
from ._web_component import web_component
1314

1415
BootstrapColorMode = Literal["light", "dark"]
@@ -80,14 +81,16 @@ def validate_dark_mode_option(mode: BootstrapColorMode) -> BootstrapColorMode:
8081

8182
@no_example()
8283
def update_dark_mode(
83-
mode: BootstrapColorMode, *, session: Optional[Session] = None
84+
mode: BootstrapColorMode,
85+
*,
86+
session: MISSING_TYPE = MISSING,
8487
) -> None:
85-
session = require_active_session(session)
88+
active_session = require_active_session(session)
8689

8790
mode = validate_dark_mode_option(mode)
8891

8992
msg: dict[str, object] = {
9093
"method": "toggle",
9194
"value": mode,
9295
}
93-
session._send_message_sync({"custom": {"bslib.toggle-dark-mode": msg}})
96+
active_session._send_message_sync({"custom": {"bslib.toggle-dark-mode": msg}})

shiny/ui/_modal.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"modal_remove",
88
)
99

10-
from typing import TYPE_CHECKING, Literal, Optional
10+
from typing import Literal, Optional
1111

1212
from htmltools import HTML, Tag, TagAttrs, TagAttrValue, TagChild, div, tags
1313

@@ -16,9 +16,6 @@
1616
from ..session import require_active_session
1717
from ..types import MISSING, MISSING_TYPE
1818

19-
if TYPE_CHECKING:
20-
from ..session import Session
21-
2219

2320
@add_example(ex_dir="../api-examples/modal")
2421
def modal_button(label: TagChild, icon: TagChild = None, **kwargs: TagAttrValue) -> Tag:

0 commit comments

Comments
 (0)