mik-laj commented on a change in pull request #5408: [AIRFLOW-4763] Allow list 
in DockerOperator.command
URL: https://github.com/apache/airflow/pull/5408#discussion_r298720530
 
 

 ##########
 File path: airflow/operators/docker_operator.py
 ##########
 @@ -247,7 +247,7 @@ def execute(self, context):
                     if self.xcom_all else line.encode('utf-8')
 
     def get_command(self):
-        if self.command is not None and self.command.strip().find('[') == 0:
+        if isinstance(self.command, str) and self.command.strip().find('[') == 
0:
 
 Review comment:
   When a string is encountered, but the string looks like it contains arrays 
(starts with the character "[") it is processed by literal_parse, which creates 
the real table from the string.
   ```
   >>> import ast
   >>> ast.literal_eval('["A", "B"]')
   ['A', 'B']
   >>>
   ```
   
   Currently, Jinja always accepts a string at the input and returns a string. 
However, the mentioned PR discussed an alternative solution to the one used in 
this PR.
   
   I can not do it at the moment. I just wanted to answer your question.

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

Reply via email to