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 2021/01/08 01:50:38 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #12677: Refactor SQL/BigQuery/Qubole Check operators

potiuk commented on a change in pull request #12677:
URL: https://github.com/apache/airflow/pull/12677#discussion_r553695096



##########
File path: airflow/providers/apache/druid/operators/druid_check.py
##########
@@ -15,74 +15,23 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from typing import Any, Dict, Optional
+import warnings
 
-from airflow.exceptions import AirflowException
-from airflow.operators.check_operator import CheckOperator
-from airflow.providers.apache.druid.hooks.druid import DruidDbApiHook
-from airflow.utils.decorators import apply_defaults
+from airflow.operators.sql import SQLCheckOperator
 
 
-class DruidCheckOperator(CheckOperator):
+class DruidCheckOperator(SQLCheckOperator):
     """
-    Performs checks against Druid. The ``DruidCheckOperator`` expects
-    a sql query that will return a single row. Each value on that
-    first row is evaluated using python ``bool`` casting. If any of the
-    values return ``False`` the check is failed and errors out.
-
-    Note that Python bool casting evals the following as ``False``:
-
-    * ``False``
-    * ``0``
-    * Empty string (``""``)
-    * Empty list (``[]``)
-    * Empty dictionary or set (``{}``)
-
-    Given a query like ``SELECT COUNT(*) FROM foo``, it will fail only if
-    the count ``== 0``. You can craft much more complex query that could,
-    for instance, check that the table has the same number of rows as
-    the source table upstream, or that the count of today's partition is
-    greater than yesterday's partition, or that a set of metrics are less
-    than 3 standard deviation for the 7 day average.
-    This operator can be used as a data quality check in your pipeline, and
-    depending on where you put it in your DAG, you have the choice to
-    stop the critical path, preventing from
-    publishing dubious data, or on the side and receive email alerts
-    without stopping the progress of the DAG.
-
-    :param sql: the sql to be executed
-    :type sql: str
-    :param druid_broker_conn_id: reference to the druid broker
-    :type druid_broker_conn_id: str
+    This class is deprecated.
+    Please use `airflow.operators.sql.SQLCheckOperator`.

Review comment:
       There will be very shortly - I am working on adding SemVER versioning changes and procedure for providers.




----------------------------------------------------------------
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:
users@infra.apache.org