You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/28 12:38:31 UTC

[GitHub] [airflow] mik-laj commented on issue #9518: Docker operator command

mik-laj commented on issue #9518:
URL: https://github.com/apache/airflow/issues/9518#issuecomment-650747401


   You should use 
   ```
   command="python owid_API.py -date {{ ds }}"
   ```
   or
   ```
   command=["python", "owid_API.py", "-date", "{{ ds }}"]
   ```
   I don't know what we could do to prevent a similar problem in the future.
   
   A similar problem will occur in CLI if you provide an invalid value.
   ```
   docker run -ti --rm openjdk:8-jre-slim 'bash -c "echo 1"'
   docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"bash -c \\\"echo 1\\\"\": executable file not found in $PATH": unknown.
   ```
   We may require this argument to be a list, but it is a breaking change. And this breaks one special feature of this operator.
   You can put an array into XCOM and as an argument.
   For xcom = `["bash", "-c", "echo 123"]`
   and 
   ```
   command="{{ task_instance.xcom_pull("create_dataset_task", key="dataset_id") }}"
   ```
   it will run `bash -c 'echo 123'`. Please note that the number of array elements can be dynamic.
   


----------------------------------------------------------------
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:
users@infra.apache.org