Skip to content
Merged
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
9 changes: 9 additions & 0 deletions airflow-core/src/airflow/utils/deprecation_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ def add_deprecated_classes(
:param override_deprecated_classes: override target classes with deprecated ones. If module +
target class is found in the dictionary, it will be displayed in the warning message.
:param extra_message: extra message to display in the warning or import error message

Example:
add_deprecated_classes(
{"basenotifier": {"BaseNotifier": "airflow.sdk.bases.notifier.BaseNotifier"}},
package=__name__,
)

This makes 'from airflow.notifications.basenotifier import BaseNotifier' still work,
even if 'basenotifier.py' was removed, and shows a warning with the new path.
"""
for module_name, imports in module_imports.items():
full_module_name = f"{package}.{module_name}"
Expand Down