Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions airflow-core/docs/howto/notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

Creating a notifier
===================
The :class:`~airflow.notifications.basenotifier.BaseNotifier` is an abstract class that provides a basic
The :class:`~airflow.sdk.definitions.notifier.BaseNotifier` is an abstract class that provides a basic
structure for sending notifications in Airflow using the various ``on_*__callback``.
It is intended for providers to extend and customize for their specific needs.

Expand All @@ -31,7 +31,7 @@ Here's an example of how you can create a Notifier class:

.. code-block:: python

from airflow.notifications.basenotifier import BaseNotifier
from airflow.sdk import BaseNotifier
from my_provider import send_message


Expand Down
2 changes: 1 addition & 1 deletion airflow-core/tests/unit/models/test_taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
from airflow.models.taskreschedule import TaskReschedule
from airflow.models.variable import Variable
from airflow.models.xcom import XComModel
from airflow.notifications.basenotifier import BaseNotifier
from airflow.providers.standard.operators.bash import BashOperator
from airflow.providers.standard.operators.empty import EmptyOperator
from airflow.providers.standard.operators.python import PythonOperator
from airflow.providers.standard.sensors.python import PythonSensor
from airflow.sdk.api.datamodels._generated import AssetEventResponse, AssetResponse
from airflow.sdk.definitions.asset import Asset, AssetAlias
from airflow.sdk.definitions.notifier import BaseNotifier
from airflow.sdk.definitions.param import process_params
from airflow.sdk.execution_time.comms import (
AssetEventsResult,
Expand Down
16 changes: 0 additions & 16 deletions airflow-core/tests/unit/notifications/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion dev/breeze/tests/test_pytest_args_for_test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def _find_all_integration_folders() -> list[str]:
"airflow-core/tests/unit/lineage",
"airflow-core/tests/unit/listeners",
"airflow-core/tests/unit/macros",
"airflow-core/tests/unit/notifications",
"airflow-core/tests/unit/plugins",
"airflow-core/tests/unit/secrets",
"airflow-core/tests/unit/security",
Expand Down
31 changes: 25 additions & 6 deletions generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"amazon": {
"deps": [
"PyAthena>=3.0.10",
"apache-airflow-providers-common-compat>=1.3.0",
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow-providers-common-sql>=1.20.0",
"apache-airflow-providers-http",
"apache-airflow>=2.9.0",
Expand Down Expand Up @@ -300,12 +300,15 @@
},
"apprise": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow>=2.9.0",
"apprise>=1.8.0"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [],
"cross-providers-deps": [
"common.compat"
],
"excluded-python-versions": [],
"state": "ready"
},
Expand Down Expand Up @@ -333,12 +336,15 @@
},
"atlassian.jira": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow>=2.9.0",
"atlassian-python-api>3.41.10"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [],
"cross-providers-deps": [
"common.compat"
],
"excluded-python-versions": [],
"state": "ready"
},
Expand Down Expand Up @@ -518,12 +524,14 @@
},
"discord": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow-providers-http",
"apache-airflow>=2.9.0"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [
"common.compat",
"http"
],
"excluded-python-versions": [],
Expand Down Expand Up @@ -1033,12 +1041,15 @@
},
"opsgenie": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow>=2.9.0",
"opsgenie-sdk>=2.1.5"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [],
"cross-providers-deps": [
"common.compat"
],
"excluded-python-versions": [],
"state": "ready"
},
Expand All @@ -1058,12 +1069,15 @@
},
"pagerduty": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow>=2.9.0",
"pdpyras>=4.2.0"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [],
"cross-providers-deps": [
"common.compat"
],
"excluded-python-versions": [],
"state": "ready"
},
Expand Down Expand Up @@ -1241,25 +1255,30 @@
},
"slack": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow-providers-common-sql>=1.20.0",
"apache-airflow>=2.9.0",
"slack_sdk>=3.19.0"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [
"common.compat",
"common.sql"
],
"excluded-python-versions": [],
"state": "ready"
},
"smtp": {
"deps": [
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow>=2.9.0"
],
"devel-deps": [],
"plugins": [],
"cross-providers-deps": [],
"cross-providers-deps": [
"common.compat"
],
"excluded-python-versions": [],
"state": "ready"
},
Expand Down
20 changes: 20 additions & 0 deletions newsfragments/48008.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The BaseNotifier class has been moved to ``airflow.sdk``.

* Types of change

* [ ] Dag changes
* [ ] Config changes
* [ ] API changes
* [ ] CLI changes
* [ ] Behaviour changes
* [ ] Plugin changes
* [ ] Dependency changes
* [x] Code interface changes

* Migration rules needed

* ruff

* AIR302

* [ ] ``airflow.notifications.basenotifier.BaseNotifier`` → ``airflow.sdk.BaseNotifier``
2 changes: 1 addition & 1 deletion providers/amazon/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Requirements
PIP package Version required
========================================== ======================
``apache-airflow`` ``>=2.9.0``
``apache-airflow-providers-common-compat`` ``>=1.3.0``
``apache-airflow-providers-common-compat`` ``>=1.6.0``
``apache-airflow-providers-common-sql`` ``>=1.20.0``
``apache-airflow-providers-http``
``boto3`` ``>=1.37.0``
Expand Down
2 changes: 1 addition & 1 deletion providers/amazon/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ requires-python = "~=3.9"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.9.0",
"apache-airflow-providers-common-compat>=1.3.0",
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow-providers-common-sql>=1.20.0",
"apache-airflow-providers-http",
# We should update minimum version of boto3 and here regularly to avoid `pip` backtracking with the number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
from typing import TYPE_CHECKING

from airflow.providers.amazon.aws.hooks.chime import ChimeWebhookHook
from airflow.providers.common.compat.notifier import BaseNotifier

if TYPE_CHECKING:
from airflow.utils.context import Context

from airflow.notifications.basenotifier import BaseNotifier


class ChimeNotifier(BaseNotifier):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from collections.abc import Sequence
from functools import cached_property

from airflow.notifications.basenotifier import BaseNotifier
from airflow.providers.amazon.aws.hooks.sns import SnsHook
from airflow.providers.common.compat.notifier import BaseNotifier


class SnsNotifier(BaseNotifier):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from collections.abc import Sequence
from functools import cached_property

from airflow.notifications.basenotifier import BaseNotifier
from airflow.providers.amazon.aws.hooks.sqs import SqsHook
from airflow.providers.common.compat.notifier import BaseNotifier


class SqsNotifier(BaseNotifier):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ def get_provider_info():
"executors": ["airflow.providers.amazon.aws.executors.ecs.ecs_executor.AwsEcsExecutor"],
"dependencies": [
"apache-airflow>=2.9.0",
"apache-airflow-providers-common-compat>=1.3.0",
"apache-airflow-providers-common-compat>=1.6.0",
"apache-airflow-providers-common-sql>=1.20.0",
"apache-airflow-providers-http",
"boto3>=1.37.0",
Expand Down
32 changes: 26 additions & 6 deletions providers/apprise/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,32 @@ The package supports the following python versions: 3.9,3.10,3.11,3.12
Requirements
------------

================== ==================
PIP package Version required
================== ==================
``apache-airflow`` ``>=2.9.0``
``apprise`` ``>=1.8.0``
================== ==================
========================================== ==================
PIP package Version required
========================================== ==================
``apache-airflow`` ``>=2.9.0``
``apache-airflow-providers-common-compat`` ``>=1.6.0``
``apprise`` ``>=1.8.0``
========================================== ==================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-apprise[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-apprise/2.0.1/changelog.html>`_.
2 changes: 2 additions & 0 deletions providers/apprise/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ requires-python = "~=3.9"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.9.0",
"apache-airflow-providers-common-compat>=1.6.0",
"apprise>=1.8.0",
]

Expand All @@ -66,6 +67,7 @@ dev = [
"apache-airflow",
"apache-airflow-task-sdk",
"apache-airflow-devel-common",
"apache-airflow-providers-common-compat",
# Additional devel dependencies (do not remove this line and add extra development dependencies)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def get_provider_info():
}
],
"notifications": ["airflow.providers.apprise.notifications.apprise.AppriseNotifier"],
"dependencies": ["apache-airflow>=2.9.0", "apprise>=1.8.0"],
"dependencies": [
"apache-airflow>=2.9.0",
"apache-airflow-providers-common-compat>=1.6.0",
"apprise>=1.8.0",
],
"devel-dependencies": [],
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

from apprise import AppriseConfig, NotifyFormat, NotifyType

from airflow.notifications.basenotifier import BaseNotifier
from airflow.providers.apprise.hooks.apprise import AppriseHook
from airflow.providers.common.compat.notifier import BaseNotifier


class AppriseNotifier(BaseNotifier):
Expand Down
32 changes: 26 additions & 6 deletions providers/atlassian/jira/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,32 @@ The package supports the following python versions: 3.9,3.10,3.11,3.12
Requirements
------------

======================== ==================
PIP package Version required
======================== ==================
``apache-airflow`` ``>=2.9.0``
``atlassian-python-api`` ``>3.41.10``
======================== ==================
========================================== ==================
PIP package Version required
========================================== ==================
``apache-airflow`` ``>=2.9.0``
``apache-airflow-providers-common-compat`` ``>=1.6.0``
``atlassian-python-api`` ``>3.41.10``
========================================== ==================

Cross provider package dependencies
-----------------------------------

Those are dependencies that might be needed in order to use all the features of the package.
You need to install the specified providers in order to use them.

You can install such cross-provider dependencies when installing from PyPI. For example:

.. code-block:: bash

pip install apache-airflow-providers-atlassian-jira[common.compat]


================================================================================================================== =================
Dependent package Extra
================================================================================================================== =================
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
================================================================================================================== =================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-atlassian-jira/3.0.1/changelog.html>`_.
2 changes: 2 additions & 0 deletions providers/atlassian/jira/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ requires-python = "~=3.9"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.9.0",
"apache-airflow-providers-common-compat>=1.6.0",
"atlassian-python-api>3.41.10",
]

Expand All @@ -66,6 +67,7 @@ dev = [
"apache-airflow",
"apache-airflow-task-sdk",
"apache-airflow-devel-common",
"apache-airflow-providers-common-compat",
# Additional devel dependencies (do not remove this line and add extra development dependencies)
]

Expand Down
Loading