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 2022/06/07 13:50:40 UTC

[GitHub] [airflow] malthe commented on a diff in pull request #23712: Add databricks job sensors

malthe commented on code in PR #23712:
URL: https://github.com/apache/airflow/pull/23712#discussion_r891256679


##########
airflow/providers/databricks/sensors/databricks.py:
##########
@@ -0,0 +1,103 @@
+#
+# 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.
+"""Databricks sensors"""
+
+from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Union
+
+from airflow.exceptions import AirflowException
+from airflow.providers.databricks.hooks.databricks import DatabricksHook
+from airflow.sensors.base import BaseSensorOperator
+from airflow.utils.context import Context
+
+if TYPE_CHECKING:
+    from airflow.sensors.base import PokeReturnValue
+
+
+class DatabricksJobRunSensor(BaseSensorOperator):
+    """
+    Check for the state of a submitted Databricks job run or specific task of a job run.
+
+    :param run_id: Id of the submitted Databricks job run or specific task of a job run. (templated)

Review Comment:
   Isn't the base use-case for this that you've started a job (or jobs) by submitting it in a previous task and now you want to wait for their completion?
   
   Then other use-cases like looking up a job by name, those seem a bit more esoteric to me. Perhaps that can be done using Python code if we provide a code example?
   
   Sometimes less is more.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org