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/11/26 08:20:29 UTC

[GitHub] [airflow] ashb commented on a change in pull request #12638: Allow BashOperator to take command as list

ashb commented on a change in pull request #12638:
URL: https://github.com/apache/airflow/pull/12638#discussion_r530844550



##########
File path: airflow/operators/bash.py
##########
@@ -19,16 +19,22 @@
 
 import os
 import signal
+import warnings
 from subprocess import PIPE, STDOUT, Popen
 from tempfile import TemporaryDirectory, gettempdir
-from typing import Dict, Optional
+from typing import Dict, List, Optional, Union
 
 from airflow.exceptions import AirflowException
 from airflow.models import BaseOperator
 from airflow.utils.decorators import apply_defaults
 from airflow.utils.operator_helpers import context_to_airflow_vars
 
 
+def _is_bash_script(input_string: str):
+    input_list = input_string.split(" ")
+    return len(input_list) == 1 and len(input_string) > 2 and input_string[3:] == ".sh"

Review comment:
       This check doesn't seem right it only also for `a.sh` not `longer.sh`




----------------------------------------------------------------
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