Skip to content

Commit c42a375

Browse files
authored
[AIRFLOW-6644][AIP-21] Move service classes to providers package (#7265)
* [AIP-21] Move contrib.hooks.cloudant_hook providers.cloudant.hooks.cloudant * [AIP-21] Move contrib.hooks.databricks_hook providers.databricks.hooks.databricks * [AIP-21] Move contrib.hooks.datadog_hook providers.datadog.hooks.datadog * [AIP-21] Move contrib.hooks.dingding_hook providers.dingding.hooks.dingding * [AIP-21] Move contrib.hooks.discord_webhook_hook providers.ddiscord.hooks.discord_webhook * [AIP-21] Move contrib.hooks.gdrive_hook providers.google.suite.hooks.drive * [AIP-21] Move contrib.hooks.jenkins_hook providers.jenking.hooks.jenkins * [AIP-21] Move contrib.hooks.opsgenie_alert_hook providers.opsgenie.hooks.opsgenie_alert * [AIP-21] Move contrib.hooks.pagerduty_hook providers.pagerduty.hooks.pagerduty * [AIP-21] Move contrib.hooks.qubole_check_hook providers.qubole.hooks.qubole_check * [AIP-21] Move contrib.hooks.qubole_hook providers.qubole.hooks.qubole * [AIP-21] Move contrib.hooks.salesforce_hook providers.salesforce.hooks.salesforce * [AIP-21] Move contrib.hooks.segment_hook providers.segment.hooks.segment * [AIP-21] Move contrib.hooks.snowflake_hook providers.snowflake.hooks.snowflake * [AIP-21] Move contrib.hooks.vertica_hook providers.vertica.hooks.vertica * [AIP-21] Move gcp.hooks.gsheets providers.google.suite.hooks.sheets * [AIP-21] Move hooks.slack_hook providers.slack.hooks.slack * [AIP-21] Move hooks.zendesk_hook providers.zendesk.hooks.zendesk * [AIP-21] Move contrib.operators.databricks_operator providers.databricks.operators.databricks * [AIP-21] Move contrib.operators.dingding_operator providers.dindding.operators.dingding * [AIP-21] Move contrib.operators.discord_webhook_operator providers.discord.operators.discord_webhook * [AIP-21] Move contrib.operators.jenkins_job_trigger_operator providers.jenking.operators.jenkins_job_trigger * [AIP-21] Move contrib.operators.opsgenie_alert_operator providers.opsgenie.operators.opsgenie_alert * [AIP-21] Move contrib.operators.qubole_check_operator providers.qubole.operators.qubole_check * [AIP-21] Move contrib.operators.qubole_operator providers.qubole.operators.qubole * [AIP-21] Move contrib.operators.segment_track_event_operator providers.segment.operators.segment_track_event * [AIP-21] Move contrib.operators.slack_webhook_operator providers.slack.operators.slack_webhook * [AIP-21] Move contrib.operators.vertica_operator providers.vertica.operators.vertica * [AIP-21] Move contrib.sensors.datadog_sensor providers.datadog.sensors.datadog * [AIP-21] Move contrib.sensors.qubole_sensor providers.qubole.sensors.qubole * [AIP-21] Move operators.slack_operator providers.slack.operators.slack * Update docs
1 parent 7e29430 commit c42a375

File tree

188 files changed

+6987
-4373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+6987
-4373
lines changed

airflow/contrib/example_dags/example_databricks_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"""
3434

3535
from airflow import DAG
36-
from airflow.contrib.operators.databricks_operator import DatabricksSubmitRunOperator
36+
from airflow.providers.databricks.operators.databricks import DatabricksSubmitRunOperator
3737
from airflow.utils.dates import days_ago
3838

3939
default_args = {

airflow/contrib/example_dags/example_dingding_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from datetime import timedelta
2323

2424
from airflow import DAG
25-
from airflow.contrib.operators.dingding_operator import DingdingOperator
25+
from airflow.providers.dindding.operators.dingding import DingdingOperator
2626
from airflow.utils.dates import days_ago
2727

2828
args = {

airflow/contrib/example_dags/example_qubole_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
import random
3333

3434
from airflow import DAG
35-
from airflow.contrib.operators.qubole_operator import QuboleOperator
3635
from airflow.operators.dummy_operator import DummyOperator
3736
from airflow.operators.python import BranchPythonOperator, PythonOperator
37+
from airflow.providers.qubole.operators.qubole import QuboleOperator
3838
from airflow.utils.dates import days_ago
3939

4040
default_args = {

airflow/contrib/example_dags/example_qubole_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"""
3030

3131
from airflow import DAG
32-
from airflow.contrib.sensors.qubole_sensor import QuboleFileSensor, QubolePartitionSensor
32+
from airflow.providers.qubole.sensors.qubole import QuboleFileSensor, QubolePartitionSensor
3333
from airflow.utils import dates
3434

3535
default_args = {

airflow/contrib/hooks/cloudant_hook.py

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,14 @@
1616
# KIND, either express or implied. See the License for the
1717
# specific language governing permissions and limitations
1818
# under the License.
19-
"""Hook for Cloudant"""
20-
from cloudant import cloudant
19+
"""This module is deprecated. Please use `airflow.providers.cloudant.hooks.cloudant`."""
2120

22-
from airflow.exceptions import AirflowException
23-
from airflow.hooks.base_hook import BaseHook
21+
import warnings
2422

23+
# pylint: disable=unused-import
24+
from airflow.providers.cloudant.hooks.cloudant import CloudantHook # noqa
2525

26-
class CloudantHook(BaseHook):
27-
"""
28-
Interact with Cloudant. This class is a thin wrapper around the cloudant python library.
29-
30-
.. seealso:: the latest documentation `here <https://python-cloudant.readthedocs.io/en/latest/>`_.
31-
32-
:param cloudant_conn_id: The connection id to authenticate and get a session object from cloudant.
33-
:type cloudant_conn_id: str
34-
"""
35-
36-
def __init__(self, cloudant_conn_id='cloudant_default'):
37-
self.cloudant_conn_id = cloudant_conn_id
38-
39-
def get_conn(self):
40-
"""
41-
Opens a connection to the cloudant service and closes it automatically if used as context manager.
42-
43-
.. note::
44-
In the connection form:
45-
- 'host' equals the 'Account' (optional)
46-
- 'login' equals the 'Username (or API Key)' (required)
47-
- 'password' equals the 'Password' (required)
48-
49-
:return: an authorized cloudant session context manager object.
50-
:rtype: cloudant
51-
"""
52-
conn = self.get_connection(self.cloudant_conn_id)
53-
54-
self._validate_connection(conn)
55-
56-
cloudant_session = cloudant(user=conn.login, passwd=conn.password, account=conn.host)
57-
58-
return cloudant_session
59-
60-
def _validate_connection(self, conn):
61-
for conn_param in ['login', 'password']:
62-
if not getattr(conn, conn_param):
63-
raise AirflowException('missing connection parameter {conn_param}'.format(
64-
conn_param=conn_param))
26+
warnings.warn(
27+
"This module is deprecated. Please use `airflow.providers.cloudant.hooks.cloudant`.",
28+
DeprecationWarning, stacklevel=2
29+
)

0 commit comments

Comments
 (0)