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/03/15 09:01:26 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #7728: [AIRFLOW-5610] Add ability to specify multiple objects to copy in GCSToGCSOperator

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:
users@infra.apache.org


With regards,
Apache Git Services