Skip to content

Apprise: No module named 'airflow.sdk.definitions.notifier' #49605

@GaMeRaM

Description

@GaMeRaM

Apache Airflow Provider(s)

apprise

Versions of Apache Airflow Providers

apache-airflow-providers-docker==4.3.1
apache-airflow-providers-apprise[common.compat]==2.0.2
apache-airflow-providers-amazon[s3fs]==9.6.1
apache-airflow-providers-standard==1.0.0

Tried without the compat - got same results

Apache Airflow version

3.0.0

Operating System

Ubuntu 22.04.5 LTS

Deployment

Docker-Compose

Deployment details

Docker version 28.1.1
apache/airflow:3.0.0-python3.12

What happened

When i tried to use apprise provider the UI showed DAG import error with this traceback:

Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/apprise/notifications/apprise.py", line 26, in <module>
    from airflow.providers.common.compat.notifier import BaseNotifier
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/common/compat/notifier/__init__.py", line 27, in <module>
    from airflow.sdk.definitions.notifier import BaseNotifier
ModuleNotFoundError: No module named 'airflow.sdk.definitions.notifier'

What you think should happen instead

It should work correctly without erroring out

How to reproduce

  1. Set up a docker container with installed requirements
  2. Create a dag with minimal test config
import pendulum
from airflow.decorators import dag, task
from airflow.providers.apprise.notifications.apprise import AppriseNotifier


@task()
def check_apprise():
    notifier = AppriseNotifier()
    notifier.notify(
        body="Hello, world!",
        title="Test",
    )


@dag(
    schedule=None,
    start_date=pendulum.datetime(2024, 1, 1),
    catchup=False,
    max_active_runs=1
)
def apprise_check():
    check_apprise()


apprise_check_dag = apprise_check()
  1. Get error

Anything else

It happens every time

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions