-
-
Notifications
You must be signed in to change notification settings - Fork 575
Open
Description
Python version: 3.12
Panel: 1.8.3
File: .venv/lib/python3.12/site-packages/panel/io/state.py
Issue: When I do following code,
def on_session_destroyed(session_context: BokehSessionContext) -> None:
if session_context.request is not None:
print(f' session destroyed at the {session_context.request.uri} endpoint with session ID: {session_context.id}')
...
pn.state.on_session_destroyed(callback=on_session_destroyed) I get type annotation issue
At run time, session_context: is BokehSessionContext type and its documented in https://panel.holoviz.org/how_to/callbacks/session.html but the code panel/io/state.py do not have correct type annotations for call backs.
Expected behavior:
Correct the callback function's type annotations.
Ex:
in state.py
def on_session_destroyed(self, callback: Callable[[SessionContext], None]) -> None:
should be
def on_session_destroyed(self, callback: Callable[[BokehSessionContext ], None]) -> None:
Metadata
Metadata
Assignees
Labels
No labels