Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize Opsgenie provider classes #20454

Merged
merged 3 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/contrib/hooks/opsgenie_alert_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import warnings

from airflow.providers.opsgenie.hooks.opsgenie_alert import OpsgenieAlertHook # noqa
from airflow.providers.opsgenie.hooks.alert import OpsgenieAlertHook # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.opsgenie.hooks.opsgenie_alert`.",
Expand Down
2 changes: 1 addition & 1 deletion airflow/contrib/operators/opsgenie_alert_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import warnings

from airflow.providers.opsgenie.operators.opsgenie_alert import OpsgenieAlertOperator # noqa
from airflow.providers.opsgenie.operators.opsgenie import OpsgenieAlertOperator # noqa

warnings.warn(
"This module is deprecated. Please use `airflow.providers.opsgenie.operators.opsgenie_alert`.",
Expand Down
10 changes: 10 additions & 0 deletions airflow/providers/opsgenie/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ Removed the ``OpsegnieAlertHook.execute`` method and replaced it with ``Opsegnie
``OpsgenieAlertHook`` now takes ``visible_to`` instead of ``visibleTo`` key in the payload.
``OpsgenieAlertHook`` now takes ``request_id`` instead of ``requestId`` key in the payload.

Changes were made to classes paths:

+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| Class | Old Path | New Path |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| OpsgenieAlertHook | airflow.providers.opsgenie.hooks.opsgenie_alert | airflow.providers.opsgenie.hooks.opsgenie |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| OpsgenieAlertOperator | airflow.providers.opsgenie.operators.opsgenie_alert | airflow.providers.opsgenie.operators.opsgenie |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| Class | Old Path | New Path |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| OpsgenieAlertHook | airflow.providers.opsgenie.hooks.opsgenie_alert | airflow.providers.opsgenie.hooks.opsgenie |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
| OpsgenieAlertOperator | airflow.providers.opsgenie.operators.opsgenie_alert | airflow.providers.opsgenie.operators.opsgenie |
+-----------------------+-----------------------------------------------------+-----------------------------------------------+
+---------------------------+---------------------------------------------------------+---------------------------------------------------+
| Class | Old Path | New Path |
+---------------------------+---------------------------------------------------------+---------------------------------------------------+
| ``OpsgenieAlertHook`` | ``airflow.providers.opsgenie.hooks.opsgenie_alert`` | ``airflow.providers.opsgenie.hooks.opsgenie`` |
+---------------------------+-------------------------------------------------------------+-----------------------------------------------+
| ``OpsgenieAlertOperator`` | ``airflow.providers.opsgenie.operators.opsgenie_alert`` | ``airflow.providers.opsgenie.operators.opsgenie`` |
+---------------------------+---------------------------------------------------------+---------------------------------------------------+

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the paths backward compatible so no need for the table at the end :)


2.0.1
.....

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from datetime import datetime

from airflow import DAG
from airflow.providers.opsgenie.operators.opsgenie_alert import OpsgenieAlertOperator
from airflow.providers.opsgenie.operators.opsgenie import OpsgenieAlertOperator

with DAG(
dag_id="opsgenie_alert_operator_dag",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Any, Dict, List, Optional

from airflow.models import BaseOperator
from airflow.providers.opsgenie.hooks.opsgenie_alert import OpsgenieAlertHook
from airflow.providers.opsgenie.hooks.opsgenie import OpsgenieAlertHook


class OpsgenieAlertOperator(BaseOperator):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from opsgenie_sdk.exceptions import AuthenticationException

from airflow.models import Connection
from airflow.providers.opsgenie.hooks.opsgenie_alert import OpsgenieAlertHook
from airflow.providers.opsgenie.hooks.opsgenie import OpsgenieAlertHook
from airflow.utils import db


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import unittest

from airflow.models.dag import DAG
from airflow.providers.opsgenie.operators.opsgenie_alert import OpsgenieAlertOperator
from airflow.providers.opsgenie.operators.opsgenie import OpsgenieAlertOperator
from airflow.utils import timezone

DEFAULT_DATE = timezone.datetime(2017, 1, 1)
Expand Down