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 2019/10/30 21:39:13 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6473: [AIRFLOW-5819] Update AWSBatchOperator default value

ashb commented on a change in pull request #6473: [AIRFLOW-5819] Update AWSBatchOperator default value
URL: https://github.com/apache/airflow/pull/6473#discussion_r340871679
 
 

 ##########
 File path: airflow/contrib/operators/awsbatch_operator.py
 ##########
 @@ -83,7 +83,7 @@ class AWSBatchOperator(BaseOperator):
     template_fields = ('job_name', 'overrides',)
 
     @apply_defaults
-    def __init__(self, job_name, job_definition, job_queue, overrides, array_properties=None,
+    def __init__(self, job_name, job_definition, job_queue, overrides, array_properties={},
 
 Review comment:
   You shouldn't do it like this. https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
   
   Instead in the method do
   
   ```
           self.array_properties = array_properties if array_properties is not None else {}
   ```

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


With regards,
Apache Git Services