Skip to content

Commit

Permalink
Issue 551: Added support for collections.abc.Callable in function_w…
Browse files Browse the repository at this point in the history
…rapper.py (#552)
  • Loading branch information
Marek Kondziołka authored Sep 20, 2024
1 parent 0f52f16 commit b8ccc61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fugue/dataframe/function_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def _run_func(
annotation == Callable
or annotation == callable # pylint: disable=comparison-with-callable
or str(annotation).startswith("typing.Callable")
or str(annotation).startswith("collections.abc.Callable")
),
)
class _CallableParam(AnnotatedParam):
Expand All @@ -168,6 +169,9 @@ class _CallableParam(AnnotatedParam):
or annotation == Optional[callable]
or str(annotation).startswith("typing.Union[typing.Callable") # 3.8-
or str(annotation).startswith("typing.Optional[typing.Callable") # 3.9+
or str(annotation).startswith(
"typing.Optional[collections.abc.Callable]"
) # 3.9+
),
)
class _OptionalCallableParam(AnnotatedParam):
Expand Down

0 comments on commit b8ccc61

Please sign in to comment.