Skip to content

Allow importing the aws executors with a shorter path#39093

Merged
o-nikolas merged 5 commits into
apache:mainfrom
aws-mwaa:onikolas/aws_executors_module_path
Apr 18, 2024
Merged

Allow importing the aws executors with a shorter path#39093
o-nikolas merged 5 commits into
apache:mainfrom
aws-mwaa:onikolas/aws_executors_module_path

Conversation

@o-nikolas

@o-nikolas o-nikolas commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

Import the aws executors in the __init__.py module of their respective directories so that they can be imported with a shorter and more natural looking module path.

For example, this modules path:

airflow.providers.amazon.aws.executors.batch.batch_executor.AwsBatchExecutor

Becomes:

airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor

fixes #38524


^ 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.

Import the aws executors in the __init__.py module of their
respective directories so that they can be imported with a shorter and
more natural looking module path.

For example, this modules path:

`airflow.providers.amazon.aws.executors.batch.batch_executor.AwsBatchExecutor`

Becomes:

`airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor`
@o-nikolas o-nikolas requested a review from eladkal as a code owner April 17, 2024 17:56
@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Apr 17, 2024
Comment thread airflow/providers/amazon/aws/executors/batch/__init__.py Outdated
Comment thread airflow/providers/amazon/aws/executors/batch/__init__.py Outdated
Comment thread airflow/providers/amazon/aws/executors/batch/__init__.py Outdated

@dirrao dirrao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. It's worth to add unit test with shorter path.

@Taragolis

Copy link
Copy Markdown
Contributor

Just an idea, maybe move it into the package root and make it lazy-loaded thought PEP-562, e.g. the same way as if does into the:

Comment thread airflow/providers/amazon/aws/executors/batch/__init__.py Outdated
@o-nikolas o-nikolas merged commit 4b9b400 into apache:main Apr 18, 2024
@o-nikolas o-nikolas deleted the onikolas/aws_executors_module_path branch April 18, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants