fix optional wrapping of static call methods in pyi
This commit is contained in:
parent
68547dce4c
commit
42a2a6f640
@ -151,7 +151,7 @@ def default_backend_exception_handler(exception: Exception) -> EventSpec:
|
||||
position="top-center",
|
||||
id="backend_error",
|
||||
style={"width": "500px"},
|
||||
) # pyright: ignore [reportReturnType]
|
||||
)
|
||||
else:
|
||||
error_message.insert(0, "An error occurred.")
|
||||
return window_alert("\n".join(error_message))
|
||||
|
@ -177,7 +177,7 @@ class ToastNamespace(ComponentNamespace):
|
||||
@staticmethod
|
||||
def __call__(
|
||||
message: Union[str, Var] = "", level: Optional[str] = None, **props
|
||||
) -> "Optional[EventSpec]":
|
||||
) -> "EventSpec":
|
||||
"""Send a toast message.
|
||||
|
||||
Args:
|
||||
|
@ -699,6 +699,7 @@ def _generate_staticmethod_call_functiondef(
|
||||
value=_get_type_hint(
|
||||
typing.get_type_hints(clz.__call__).get("return", None),
|
||||
type_hint_globals,
|
||||
is_optional=False,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
@ -1623,7 +1623,7 @@ async def test_state_with_invalid_yield(capsys, mock_app):
|
||||
id="backend_error",
|
||||
position="top-center",
|
||||
style={"width": "500px"},
|
||||
) # pyright: ignore [reportCallIssue, reportArgumentType]
|
||||
)
|
||||
],
|
||||
token="",
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user