Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtenedor committed Nov 6, 2023
1 parent 6e9ddaf commit d862fb4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/pyspark/sql/worker/analyze_udtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def main(infile: IO, outfile: IO) -> None:
error_prefix = f"Failed to evaluate the user-defined table function '{handler.__name__}'"

def format_error(msg: str) -> str:
return dedent(msg).replace('\n', ' ')
return dedent(msg).replace("\n", " ")

# Check invariants about the 'analyze' and 'eval' methods before running them.
def check_method_invariants_before_running(
Expand Down Expand Up @@ -185,10 +185,12 @@ def arguments(num):
)

check_method_invariants_before_running(
inspect.getfullargspec(handler.analyze), "static analyze", is_static = True)
inspect.getfullargspec(handler.analyze), "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), "eval", is_static=False
)

# Invoke the UDTF's 'analyze' method.
result = handler.analyze(*args, **kwargs) # type: ignore[attr-defined]
Expand Down

0 comments on commit d862fb4

Please sign in to comment.