kaxil commented on a change in pull request #6596: [AIRFLOW-6004] Untangle
Executors class to avoid cyclic imports. Depends on [AIRFLOW-6010]
URL: https://github.com/apache/airflow/pull/6596#discussion_r350364627
##########
File path: airflow/executors/celery_executor.py
##########
@@ -57,17 +61,17 @@
@app.task
-def execute_command(command_to_exec):
+def task(command_to_exec: str):
+ """Executes command."""
log = LoggingMixin().log
log.info("Executing command in Celery: %s", command_to_exec)
env = os.environ.copy()
try:
subprocess.check_call(command_to_exec, stderr=subprocess.STDOUT,
close_fds=True, env=env)
except subprocess.CalledProcessError as e:
- log.exception('execute_command encountered a CalledProcessError')
+ log.exception('execute command encountered a CalledProcessError')
Review comment:
We should change this exception. As `execute_command` is renamed to `task`
(Maybe we should change the name from task to something else to not confuse
with Airflow's task). WDYT?
```diff
- log.exception('execute command encountered a CalledProcessError')
+ log.exception('task encountered a CalledProcessError')
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services