potiuk commented on a change in pull request #5145: [AIRFLOW-4379] Remove 
duplicate code & Add validation in gcs_to_gcs.py
URL: https://github.com/apache/airflow/pull/5145#discussion_r277210998
 
 

 ##########
 File path: airflow/contrib/operators/gcs_to_gcs.py
 ##########
 @@ -143,51 +143,50 @@ def execute(self, context):
             google_cloud_storage_conn_id=self.google_cloud_storage_conn_id,
             delegate_to=self.delegate_to
         )
-        log_message = 'Executing copy of gs://{0}/{1} to gs://{2}/{3}'
+
+        if self.destination_bucket is None:
+            self.log.warning(
+                'destination_bucket is None. Defaulting it to source_bucket 
(%s)',
+                self.source_bucket)
+            self.destination_bucket = self.source_bucket
 
         if self.wildcard in self.source_object:
+
+            if self.source_object.count(self.wildcard) > 1:
 
 Review comment:
   I propose that the wildcard is turned into WILDCARD to show that it is 
really a constant. Using lowercase makes me think that you can modify it 
somehow. I would also consider naming it ASTERISK or STAR because wildcard has 
a bit broader meaning https://en.wikipedia.org/wiki/Wildcard_character (and we 
explicitly only support *).

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