QuboleCheckOperator

Qubole

Performs checks against Qubole Commands. QuboleCheckOperator expects a command that will be executed on QDS. By default, each value on first row of the result of this Qubole Command is evaluated using python bool casting. If any of the values return False, the check is failed and errors out.

View on GitHub

Last Updated: Oct. 23, 2022

Access Instructions

Install the Qubole provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

qubole_conn_idConnection id which consists of qds auth_token
results_parser_callableThis is an optional parameter to extend the flexibility of parsing the results of Qubole command to the users. This is a Python callable which can hold the logic to parse list of rows returned by Qubole command. By default, only the values on first row are used for performing checks. This callable should return a list of records on which the checks have to be performed.

Documentation

Performs checks against Qubole Commands. QuboleCheckOperator expects a command that will be executed on QDS. By default, each value on first row of the result of this Qubole Command 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.

See also

For more information on how to use this operator, take a look at the guide: Perform checks

kwargs:

Arguments specific to Qubole command can be referred from QuboleOperator docs.

Note

All fields in common with template fields of QuboleOperator and SQLCheckOperator are template-supported.

Was this page helpful?