alekseiloginov commented on a change in pull request #20882:
URL: https://github.com/apache/airflow/pull/20882#discussion_r817914659



##########
File path: airflow/providers/google/cloud/operators/looker.py
##########
@@ -0,0 +1,105 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+"""This module contains Google Cloud Looker operators."""
+
+from typing import Optional, Dict
+
+from airflow.models.baseoperator import BaseOperator
+from airflow.providers.google.cloud.hooks.looker import LookerHook
+
+
+class LookerStartPdtBuildOperator(BaseOperator):
+    """
+    Submits a PDT materialization job to Looker.
+
+    :param looker_conn_id: Required. The connection ID to use connecting to 
Looker.
+    :type looker_conn_id: str
+    :param model: Required. The model of the PDT to start building.
+    :type model: str
+    :param view: Required. The view of the PDT to start building.
+    :type view: str
+    :param query_params: Optional. Additional materialization parameters.
+    :type query_params: Dict
+    :param asynchronous: Optional. Flag indicating whether to wait for the job 
to finish or return immediately.
+        This is useful for submitting long running jobs and
+        waiting on them asynchronously using the LookerCheckPdtBuildSensor
+    :type asynchronous: bool
+    :param cancel_on_kill: Optional. Flag which indicates whether cancel the 
hook's job or not, when on_kill is called.
+    :type cancel_on_kill: bool
+    :param wait_time: Optional. Number of seconds between checks for job to be 
ready. Used only if ``asynchronous`` is False.
+    :type wait_time: int
+    :param wait_timeout: Optional. How many seconds wait for job to be ready. 
Used only if ``asynchronous`` is False.
+    :type wait_timeout: int
+    """
+
+    def __init__(
+        self,
+        looker_conn_id: str,
+        model: str,
+        view: str,
+        query_params: Optional[Dict] = None,
+        asynchronous: bool = False,
+        cancel_on_kill: bool = True,
+        wait_time: int = 10,
+        wait_timeout: Optional[int] = None,
+        **kwargs) -> None:
+        super().__init__(**kwargs)
+        self.model = model
+        self.view = view
+        self.query_params = query_params
+        self.looker_conn_id = looker_conn_id
+        self.asynchronous = asynchronous
+        self.cancel_on_kill = cancel_on_kill
+        self.wait_time = wait_time
+        self.wait_timeout = wait_timeout
+        self.hook: Optional[LookerHook] = None
+        self.materialization_id: Optional[str] = None
+
+    def execute(self, context):

Review comment:
       Done! ✅ 




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