Skip to content

Deprecate lazy import AirflowException from airflow - #34541

Merged
vincbeck merged 1 commit into
apache:mainfrom
Taragolis:deprecate-airflow-exception
Oct 6, 2023
Merged

Deprecate lazy import AirflowException from airflow#34541
vincbeck merged 1 commit into
apache:mainfrom
Taragolis:deprecate-airflow-exception

Conversation

@Taragolis

Copy link
Copy Markdown
Contributor

Follow-Up: #34512 (comment)

I've also check that there is no examples with from airflow import AirflowException in docs.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@hussein-awalahussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A small nit, LGTM

Comment threadairflow/__init__.py
warnings.warn(
f"Import {name!r} directly from the airflow module is deprecated and "
f"will be removed in the future. Please import it from 'airflow{module_path}.{attr_name}'.",
DeprecationWarning,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should use RemovedInAirflow3Warning isntead?

@TaragolisTaragolisSep 22, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It required to import from airflow.exceptions module 🙂, which might be a reason for circular import.

I guess for the same reason we do not use internal warning in airflow.configuration and use generic one

@vincbeck
vincbeck merged commit 7764a51 into apache:mainOct 6, 2023
@ephraimbuddyephraimbuddy added this to the Airflow 2.8.0 milestone Oct 27, 2023
@ephraimbuddyephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Oct 27, 2023
@Taragolis
Taragolis deleted the deprecate-airflow-exception branch October 27, 2023 09:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:misc/internalChangelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Taragolis@Lee-W@hussein-awala@vincbeck@ephraimbuddy