dabla commented on code in PR #59087:
URL: https://github.com/apache/airflow/pull/59087#discussion_r2627055980
##########
task-sdk/src/airflow/sdk/bases/decorator.py:
##########
@@ -636,6 +640,28 @@ def __call__(
def override(self, **kwargs: Any) -> Task[FParams, FReturn]: ...
+def unwrap_callable(func):
+ from airflow.sdk.bases.decorator import _TaskDecorator
+ from airflow.sdk.definitions.mappedoperator import OperatorPartial
+
+ if isinstance(func, (_TaskDecorator, OperatorPartial)):
+ # unwrap to the real underlying callable
+ return getattr(func, "function", getattr(func, "_func", func))
+ return func
+
+
+def is_async_callable(func):
Review Comment:
I refactored the is_async_callable method to take into account more
scenario's like with FastAPI, I also added different test cases documenting the
methods behaviour.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]