anishgirianish commented on code in PR #62343:
URL: https://github.com/apache/airflow/pull/62343#discussion_r2893498845
##########
airflow-core/src/airflow/executors/base_executor.py:
##########
@@ -240,10 +242,18 @@ def queue_workload(self, workload: workloads.All,
session: Session) -> None:
f"See LocalExecutor or CeleryExecutor for reference
implementation."
)
self.queued_callbacks[workload.callback.id] = workload
+ elif isinstance(workload, workloads.TestConnection):
+ if not self.supports_connection_test:
+ raise NotImplementedError(
+ f"{type(self).__name__} does not support TestConnection
workloads. "
+ f"Set supports_connection_test = True and implement
connection test handling "
+ f"in _process_workloads(). See LocalExecutor for reference
implementation."
+ )
+ self.queued_connection_tests[str(workload.connection_test_id)] =
workload
else:
raise ValueError(
f"Un-handled workload type {type(workload).__name__!r} in
{type(self).__name__}. "
- f"Workload must be one of: ExecuteTask, ExecuteCallback."
+ f"Workload must be one of: ExecuteTask, ExecuteCallback,
TestConnection."
Review Comment:
Great idea, will explore this as a follow-up!
--
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]