Skip to content

Commit 48064eb

Browse files
committed
Fix some type issues
1 parent 3e48c60 commit 48064eb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

shinywidgets/_dependencies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def require_dependency(w: Widget, session: Session) -> Optional[HTMLDependency]:
8888
if module_dir is None:
8989
warnings.warn(
9090
f"Failed to discover JavaScript dependencies for {type(w)}."
91-
+ " Make sure it is installed as a jupyter notebook extension."
91+
+ " Make sure it is installed as a jupyter notebook extension.",
92+
stacklevel=2,
9293
)
9394
return None
9495

shinywidgets/_shinywidgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
_remove_buffers, # pyright: ignore[reportUnknownVariableType, reportGeneralTypeIssues]
2222
)
2323
from ipywidgets.widgets.widget import Widget
24-
from shiny import Session, event, reactive
24+
from shiny import Session, reactive
2525
from shiny._utils import run_coro_sync, wrap_async
2626
from shiny.http_staticfiles import StaticFiles
2727
from shiny.module import resolve_id
@@ -64,7 +64,7 @@ def init_shiny_widget(w: Widget):
6464
# Break out of any module-specific session. Otherwise, input.shinywidgets_comm_send
6565
# will be some module-specific copy.
6666
while hasattr(session, "_parent"):
67-
session = session._parent
67+
session = cast(Session, session._parent)
6868

6969
# `Widget` has `comm = Instance('ipykernel.comm.Comm')` which means we'd get a
7070
# runtime error if we try to set this attribute to a different class, but
@@ -280,7 +280,7 @@ def reactive_depend(
280280
Reactively read a Widget's trait(s)
281281
"""
282282

283-
ctx = reactive.get_current_context()
283+
ctx = reactive.get_current_context() # pyright: ignore[reportPrivateImportUsage]
284284

285285
def invalidate(change: object):
286286
ctx.invalidate()

0 commit comments

Comments
 (0)