Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion shiny/express/_module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import functools
from typing import Callable, Concatenate, ParamSpec, TypeVar
from typing import Callable, TypeVar

from .._typing_extensions import Concatenate, ParamSpec
from ..module import Id
from ..session._session import Inputs, Outputs, Session
from ..session._utils import require_active_session, session_context
Expand Down
7 changes: 6 additions & 1 deletion shiny/render/renderer/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ class Renderer(Generic[IT]):
asynchonously.
"""

# Set _session here because some subclasses of Renderer (e.g. data_frame) set
# self._session before calling super().__init__(). If we were to set
# self._session=None in the __init__ method here, it would overwrite the value from
# the subclass. We avoid that by setting it here.
_session: Session | None = None

def __call__(self, _fn: ValueFn[IT]) -> Self:
"""
Add the value function to the renderer.
Expand Down Expand Up @@ -217,7 +223,6 @@ def __init__(
super().__init__()

self._auto_registered: bool = False
self._session: Session | None = None

# Must be done last
if callable(_fn):
Expand Down