tnk-ysk commented on code in PR #45754:
URL: https://github.com/apache/airflow/pull/45754#discussion_r1922424964


##########
providers/src/airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py:
##########
@@ -596,3 +598,112 @@ async def get_latest_operation(self, job: TransferJob) -> 
Message | None:
             operation = 
TransferOperation.deserialize(response_operation.metadata.value)
             return operation
         return None
+
+    async def list_transfer_operations(
+        self,
+        request_filter: dict | None = None,
+        **kwargs,
+    ) -> list[TransferOperation]:
+        """
+        Get a transfer operation in Google Storage Transfer Service.
+
+        :param request_filter: (Required) A request filter, as described in
+            
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/list#body.QUERY_PARAMETERS.filter
+            With one additional improvement:
+        :return: transfer operation
+
+        The ``project_id`` parameter is optional if you have a project ID
+        defined in the connection. See: :doc:`/connections/gcp`
+        """
+        # To preserve backward compatibility
+        # TODO: remove one day
+        if request_filter is None:
+            if "filter" in kwargs:
+                request_filter = kwargs["filter"]
+                if not isinstance(request_filter, dict):
+                    raise ValueError(f"The request_filter should be dict and 
is {type(request_filter)}")
+                warnings.warn(
+                    "Use 'request_filter' instead of 'filter'",
+                    AirflowProviderDeprecationWarning,

Review Comment:
   It's not that I want to add deprecated code, but to make it compatible with 
non-deferrable mode.
   
https://github.com/apache/airflow/blob/25aeb1166e6e8d093892ad3a7b1a341375b0cf51/providers/src/airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py#L255-L267
   
   I'll delete it if it is unnecessary.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to