Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dtenedor committed Nov 7, 2023
1 parent d862fb4 commit 5430d1a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/pyspark/sql/worker/analyze_udtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def check_method_invariants_before_running(
and num_expected_args != num_provided_args
):
# The UDTF call provided the wrong number of positional arguments.
def arguments(num):
def arguments(num: int) -> str:
return f"{num} argument{'' if num == 1 else 's'}"

raise PySparkValueError(
Expand Down Expand Up @@ -185,11 +185,15 @@ def arguments(num):
)

check_method_invariants_before_running(
inspect.getfullargspec(handler.analyze), "static analyze", is_static=True
inspect.getfullargspec(handler.analyze), # type: ignore[attr-defined]
"static analyze",
is_static=True
)
if hasattr(handler, "eval"):
check_method_invariants_before_running(
inspect.getfullargspec(handler.eval), "eval", is_static=False
inspect.getfullargspec(handler.eval), # type: ignore[attr-defined]
"eval",
is_static=False
)

# Invoke the UDTF's 'analyze' method.
Expand Down

0 comments on commit 5430d1a

Please sign in to comment.