kaxil commented on code in PR #63491:
URL: https://github.com/apache/airflow/pull/63491#discussion_r4065652361
##########
airflow-core/src/airflow/executors/base_executor.py:
##########
@@ -472,6 +491,29 @@ def trigger_tasks(self, open_slots: int) -> None:
if workload_list:
self._process_workloads(workload_list)
+ def trigger_tasks(self, open_slots: int) -> None:
Review Comment:
Closed by the `legacy_override_replacements` map in `__init_subclass__`. A
subclass that overrides `trigger_tasks`, `trigger_connection_tests` or
`order_queued_tasks_by_priority` now gets a warning at class-definition time
saying the override will not be invoked during scheduling, and naming the
method to override instead.
##########
airflow-core/src/airflow/executors/base_executor.py:
##########
@@ -210,6 +216,47 @@ 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:
Review Comment:
Closed by the `_LegacyWorkloadFlag` descriptor. Class-level reads return a
real bool, a `= False` declaration removes the type from the inherited
frozenset, and instance assignment reaches `__set__` instead of writing a
shadowing attribute. Confirmed with a repro against bd7b8d1e.
--
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]