potiuk commented on a change in pull request #7728: [AIRFLOW-5610] Add ability 
to specify multiple objects to copy in GCSToGCSOperator
URL: https://github.com/apache/airflow/pull/7728#discussion_r392654333
 
 

 ##########
 File path: airflow/providers/google/cloud/operators/gcs_to_gcs.py
 ##########
 @@ -169,30 +158,25 @@ def execute(self, context):
                 'destination_bucket is None. Defaulting it to source_bucket 
(%s)',
                 self.source_bucket)
             self.destination_bucket = self.source_bucket
-
-        if WILDCARD in self.source_object:
-            total_wildcards = self.source_object.count(WILDCARD)
-            if total_wildcards > 1:
-                error_msg = "Only one wildcard '*' is allowed in source_object 
parameter. " \
-                            "Found {} in {}.".format(total_wildcards, 
self.source_object)
-
-                raise AirflowException(error_msg)
-
-            prefix, delimiter = self.source_object.split(WILDCARD, 1)
-            objects = hook.list(self.source_bucket, prefix=prefix, 
delimiter=delimiter)
-
+        if not all(isinstance(item, str) for item in self.source_objects):
+            raise AirflowException('At least, one of the `objects` in the 
`source_objects` is not a string')
 
 Review comment:
   I think we should not remove the wildcard approach. It's much more powerful 
than just file extension. For example this would work with wildcard but would 
not work with suffix approach proposed:
   'folder/*/sub_folder/files'
   

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