Skip to content

Commit

Permalink
chore(pyright): Remove version restriction and fix appropriate pyrigh…
Browse files Browse the repository at this point in the history
…t errors (#1473)
  • Loading branch information
schloerke committed Jun 20, 2024
1 parent 9df7c77 commit 5ba7ef2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ dev =
flake8>=6.0.0
flake8-bugbear>=23.2.13
isort>=5.10.1
pyright==1.1.365 # must be larger than 1.1.366; https://github.com/microsoft/pyright/issues/8087
pyright>=1.1.367
pre-commit>=2.15.0
wheel
matplotlib
Expand Down
20 changes: 7 additions & 13 deletions shiny/render/transformer/_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,6 @@ def __init__(self, *args: P.args, **kwargs: P.kwargs) -> None:
self.kwargs = kwargs


def empty_params() -> TransformerParams[P]:
"""
Return `TransformerParams` definition with no parameters.
"""

def inner(*args: P.args, **kwargs: P.kwargs) -> TransformerParams[P]:
return TransformerParams[P](*args, **kwargs)

return inner()


# ======================================================================================
# Renderer / RendererSync / RendererAsync base class
# ======================================================================================
Expand Down Expand Up @@ -544,7 +533,9 @@ def __call__(
params: TransformerParams[P] | None = None,
) -> OutputRenderer[OT] | OutputRendererDecorator[IT, OT]:
if params is None:
params = self.params()
params = (
self.params()
) # pyright: ignore[reportCallIssue] ; Missing param spec args; False positive error as we know there should be no args.
if not isinstance(params, TransformerParams):
raise TypeError(
"Expected `params` to be of type `TransformerParams` but received "
Expand All @@ -560,7 +551,10 @@ def __init__(
self._fn = fn
self.ValueFn = ValueFn[IT]
self.OutputRenderer = OutputRenderer[OT]
self.OutputRendererDecorator = OutputRendererDecorator[IT, OT]

self.OutputRendererDecorator = OutputRendererDecorator[
IT, OT
] # pyright: ignore[reportAttributeAccessIssue] ; False positive error as the types should match the class definition. Not worrying about it as this code is deprecated.


@overload
Expand Down

0 comments on commit 5ba7ef2

Please sign in to comment.