potiuk commented on a change in pull request #6096: [AIRFLOW-5477] Rewrite 
Google PubSub Hook to Google Cloud Python
URL: https://github.com/apache/airflow/pull/6096#discussion_r328618915
 
 

 ##########
 File path: airflow/gcp/operators/pubsub.py
 ##########
 @@ -170,42 +234,121 @@ class PubSubSubscriptionCreateOperator(BaseOperator):
         For this to work, the service account making the request
         must have domain-wide delegation enabled.
     :type delegate_to: str
+    :param push_config: If push delivery is used with this subscription,
+        this field is used to configure it. An empty ``pushConfig`` signifies
+        that the subscriber will pull and ack messages using API methods.
+    :type push_config: Union[Dict, google.cloud.pubsub_v1.types.PushConfig]
+    :param retain_acked_messages: Indicates whether to retain acknowledged
+        messages. If true, then messages are not expunged from the 
subscription's
+        backlog, even if they are acknowledged, until they fall out of the
+        ``message_retention_duration`` window. This must be true if you would
+        like to Seek to a timestamp.
+    :type retain_acked_messages: bool
+    :param message_retention_duration: How long to retain unacknowledged 
messages
+        in the subscription's backlog, from the moment a message is published. 
If
+        ``retain_acked_messages`` is true, then this also configures the
+        retention of acknowledged messages, and thus configures how far back in
+        time a ``Seek`` can be done. Defaults to 7 days. Cannot be more than 7
+        days or less than 10 minutes.
+    :type message_retention_duration: Union[Dict, 
google.cloud.pubsub_v1.types.Duration]
+    :param labels: Client-assigned labels; see
+        https://cloud.google.com/pubsub/docs/labels
+    :type labels: Dict[str, str]
+    :param retry: (Optional) A retry object used to retry requests.
+        If None is specified, requests will not be retried.
+    :type retry: google.api_core.retry.Retry
+    :param timeout: (Optional) The amount of time, in seconds, to wait for the 
request
+        to complete. Note that if retry is specified, the timeout applies to 
each
+        individual attempt.
+    :type timeout: float
+    :param metadata: (Optional) Additional metadata that is provided to the 
method.
+    :type metadata: Sequence[Tuple[str, str]]]
+    :param topic_project: (Deprecated) the GCP project ID where the topic 
exists
+    :type topic_project: str
+    :param subscription_project: (Deprecated) the GCP project ID where the 
subscription
+        will be created. If empty, ``topic_project`` will be used.
+    :type subscription_project: str
     """
-    template_fields = ['topic_project', 'topic', 'subscription',
-                       'subscription_project']
+    template_fields = ['project_id', 'topic', 'subscription', 
'subscription_project_id']
     ui_color = '#0273d4'
 
+    # pylint: disable=too-many-arguments
     @apply_defaults
     def __init__(
             self,
-            topic_project,
             topic: str,
-            subscription=None,
-            subscription_project=None,
+            project_id: Optional[str] = None,
+            subscription: Optional[str] = None,
+            subscription_project_id: Optional[str] = None,
             ack_deadline_secs: int = 10,
             fail_if_exists: bool = False,
             gcp_conn_id: str = 'google_cloud_default',
             delegate_to: Optional[str] = None,
+            push_config: Optional[Union[Dict, PushConfig]] = None,
+            retain_acked_messages: Optional[bool] = None,
+            message_retention_duration: Optional[Union[Dict, Duration]] = None,
+            labels: Optional[Dict[str, str]] = None,
+            retry: Optional[Retry] = None,
+            timeout: Optional[float] = None,
+            metadata: Optional[Sequence[Tuple[str, str]]] = None,
+            topic_project: Optional[str] = None,
+            subscription_project: Optional[str] = None,
             *args,
             **kwargs) -> None:
+
 
 Review comment:
   Nice that we keep backwards compatibility.

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