kaxil commented on a change in pull request #4279: [AIRFLOW-3444] Explicitly 
set transfer operator description.
URL: https://github.com/apache/incubator-airflow/pull/4279#discussion_r241244269
 
 

 ##########
 File path: airflow/contrib/hooks/gcp_transfer_hook.py
 ##########
 @@ -56,34 +56,19 @@ def get_conn(self):
                                http=http_authorized, cache_discovery=False)
         return self._conn
 
-    def create_transfer_job(self, project_id, transfer_spec, **kwargs):
-        conn = self.get_conn()
-        now = datetime.datetime.utcnow()
+    def create_transfer_job(self, project_id, description, schedule, 
transfer_spec):
         transfer_job = {
             'status': 'ENABLED',
             'projectId': project_id,
+            'description': description,
             'transferSpec': transfer_spec,
-            'schedule': {
-                'scheduleStartDate': {
-                    'day': now.day,
-                    'month': now.month,
-                    'year': now.year,
-                },
-                'scheduleEndDate': {
-                    'day': now.day,
-                    'month': now.month,
-                    'year': now.year,
-                }
-            }
+            'schedule': schedule or self._schedule_once_now(),
         }
-        transfer_job.update(kwargs)
-        result = conn.transferJobs().create(body=transfer_job).execute()
-        self.wait_for_transfer_job(result, conn=conn)
+        return 
self.get_conn().transferJobs().create(body=transfer_job).execute()
 
-    def wait_for_transfer_job(self, job, conn=None):
-        conn = conn or self.get_conn()
+    def wait_for_transfer_job(self, job):
 
 Review comment:
   where do we use this method?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to