Skip to content

Commit

Permalink
remove deprecation drill
Browse files Browse the repository at this point in the history
  • Loading branch information
Bowrna committed May 22, 2024
1 parent a78ee74 commit 4d0a58c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 0 additions & 4 deletions airflow/providers/apache/drill/operators/drill.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ class DrillOperator(SQLExecuteQueryOperator):
Please use :class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:DrillOperator`
:param sql: the SQL code to be executed as a single string, or
a list of str (sql statements), or a reference to a template file.
Template references are recognized by str ending in '.sql'
Expand Down
18 changes: 11 additions & 7 deletions docs/apache-airflow-providers-apache-drill/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
under the License.
Apache Drill Operators
======================
Connect to Apache Drill via SQLExecuteQueryOperator
===================================================

Prerequisite
------------

To use :class:`~airflow.providers.apache.drill.operators.drill.DrillOperator`,
you must configure a :doc:`Drill Connection <connections/drill>`.
Use :class:`~airflow.providers.common.sql.operators.SQLExecuteQueryOperator`,
to execute SQL commands in `Drill <https://drill.apache.org/>`__ query engine.

.. _howto/operator:DrillOperator:
To connect to Drill, you must configure a :doc:`Drill Connection <connections/drill>` and can pass that as ``conn_id`` to SQLExecuteQueryOperator.

DrillOperator
-------------
.. warning::
Previously, DrillOperator was used to perform this kind of operation. But at the moment DrillOperator is deprecated and will be removed in future versions of the provider. Please consider to switch to SQLExecuteQueryOperator as soon as possible.

SQLExecuteQueryOperator
-----------------------

Executes one or more SQL queries on an Apache Drill server.
The ``sql`` parameter can be templated and be an external ``.sql`` file.
Expand All @@ -46,3 +49,4 @@ Reference
"""""""""

For further information, see `the Drill documentation on querying data <http:https://apache.github.io/drill/docs/query-data/>`_.

1 change: 0 additions & 1 deletion tests/always/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"tests/system/providers/google/cloud/life_sciences/example_life_sciences.py",
"tests/system/providers/google/marketing_platform/example_analytics.py",
# Deprecated Operators/Hooks, which replaced by common.sql Operators/Hooks
"tests/system/providers/apache/drill/example_drill_dag.py",
"tests/system/providers/jdbc/example_jdbc_queries.py",
"tests/system/providers/microsoft/mssql/example_mssql.py",
"tests/system/providers/mysql/example_mysql.py",
Expand Down
4 changes: 2 additions & 2 deletions tests/system/providers/apache/drill/example_drill_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from datetime import datetime

from airflow.models import DAG
from airflow.providers.apache.drill.operators.drill import DrillOperator
from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator

ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_drill_dag"
Expand All @@ -38,7 +38,7 @@
tags=["example"],
) as dag:
# [START howto_operator_drill]
sql_task = DrillOperator(
sql_task = SQLExecuteQueryOperator(
task_id="json_to_parquet_table",
sql="""
drop table if exists dfs.tmp.employee;
Expand Down

0 comments on commit 4d0a58c

Please sign in to comment.