jedcunningham commented on code in PR #46265:
URL: https://github.com/apache/airflow/pull/46265#discussion_r1934951270
##########
providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py:
##########
@@ -125,21 +130,54 @@ def on_celery_import_modules(*args, **kwargs):
import kubernetes.client # noqa: F401
[email protected]
-def execute_command(command_to_exec: CommandType) -> None:
- """Execute command."""
- dag_id, task_id =
BaseExecutor.validate_airflow_tasks_run_command(command_to_exec)
+# Once Celery5 is out of beta, we can pass `pydantic=True` to the decorator
and it will handle the validation
Review Comment:
Do you mean celery 5.5?
##########
providers/celery/tests/provider_tests/celery/executors/test_celery_executor.py:
##########
@@ -147,43 +147,6 @@ def test_gauge_executor_metrics(self, mock_stats_gauge,
mock_trigger_tasks, mock
]
mock_stats_gauge.assert_has_calls(calls)
- @pytest.mark.parametrize(
- "command, raise_exception",
- [
- pytest.param(["true"], True, id="wrong-command"),
- pytest.param(["airflow", "tasks"], True, id="incomplete-command"),
- pytest.param(["airflow", "tasks", "run"], False,
id="complete-command"),
- ],
- )
- def test_command_validation(self, command, raise_exception):
Review Comment:
Won't we want it for the old core provider compat tests? Maybe should be
kept but put behind a skipif(AF3...)?
--
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]