Skip to content

Commit 890fe0c

Browse files
authored
Fix typing issues (#1326)
1 parent 124e117 commit 890fe0c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

shiny/express/_module.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import functools
2-
from typing import Callable, Concatenate, ParamSpec, TypeVar
2+
from typing import Callable, TypeVar
33

4+
from .._typing_extensions import Concatenate, ParamSpec
45
from ..module import Id
56
from ..session._session import Inputs, Outputs, Session
67
from ..session._utils import require_active_session, session_context

shiny/render/renderer/_renderer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ class Renderer(Generic[IT]):
137137
asynchonously.
138138
"""
139139

140+
# Set _session here because some subclasses of Renderer (e.g. data_frame) set
141+
# self._session before calling super().__init__(). If we were to set
142+
# self._session=None in the __init__ method here, it would overwrite the value from
143+
# the subclass. We avoid that by setting it here.
144+
_session: Session | None = None
145+
140146
def __call__(self, _fn: ValueFn[IT]) -> Self:
141147
"""
142148
Add the value function to the renderer.
@@ -217,7 +223,6 @@ def __init__(
217223
super().__init__()
218224

219225
self._auto_registered: bool = False
220-
self._session: Session | None = None
221226

222227
# Must be done last
223228
if callable(_fn):

0 commit comments

Comments
 (0)