anishgirianish commented on code in PR #63491:
URL: https://github.com/apache/airflow/pull/63491#discussion_r4002261870
##########
airflow-core/src/airflow/executors/base_executor.py:
##########
@@ -210,6 +216,46 @@ def jwt_generator(self) -> JWTGenerator:
return generator
+ def __init_subclass__(cls, **kwargs: Any) -> None:
+ super().__init_subclass__(**kwargs)
+ cls._legacy_warned = set()
+ legacy_workload_types: set[WorkloadType] = set()
+ if cls.__dict__.get("supports_callbacks") is True:
+ _warn_deprecated_executor_usage(
+ f"{cls.__name__}: setting `supports_callbacks = True` as a
class attribute is "
+ f"deprecated. Add `WorkloadType.EXECUTE_CALLBACK` to
`supported_workload_types` "
+ f"instead.",
+ )
+ legacy_workload_types.add(WorkloadType.EXECUTE_CALLBACK)
+ if cls.__dict__.get("supports_connection_test") is True:
+ _warn_deprecated_executor_usage(
+ f"{cls.__name__}: setting `supports_connection_test = True` as
a class attribute is "
+ f"deprecated. Add `WorkloadType.TEST_CONNECTION` to
`supported_workload_types` "
+ f"instead.",
+ )
+ legacy_workload_types.add(WorkloadType.TEST_CONNECTION)
+ if legacy_workload_types and "supported_workload_types" not in
cls.__dict__:
+ cls.supported_workload_types = cls.supported_workload_types |
legacy_workload_types
+ legacy_override_replacements = {
Review Comment:
Added trigger_connection_tests to the warning map. thanks
--
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]