Skip to content

Make @task import from airflow.sdk - #48896

Merged
kaxil merged 2 commits into
apache:mainfrom
astronomer:get-task-decorator-working
Apr 8, 2025
Merged

Make @task import from airflow.sdk#48896
kaxil merged 2 commits into
apache:mainfrom
astronomer:get-task-decorator-working

Conversation

@kaxil

@kaxil kaxil commented Apr 7, 2025

Copy link
Copy Markdown
Member

closes #48811

Old Paths:

from airflow.decorators import dag, task, setup, teardown, task_group

New Paths:

from airflow.sdk import dag, task, setup, teardown, task_group

Backwards compatibility has been maintained.

The Base class has been moved to airflow.sdk.bases.decorator


^ 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 airflow-core/newsfragments.

Comment thread providers/standard/src/airflow/providers/standard/decorators/python_virtualenv.py Outdated

@ashb ashb 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.

I think we might need the .pyi file for decorators moved across too.

@kaxil

kaxil commented Apr 7, 2025

Copy link
Copy Markdown
Member Author

I think we might need the .pyi file for decorators moved across too.

Yeah its moved -> https://github.com/apache/airflow/blob/015a8c60924025a804976b8f52a9ec3cd943c0d1/task-sdk/src/airflow/sdk/definitions/decorators/__init__.pyi

@kaxil
kaxil force-pushed the get-task-decorator-working branch from 015a8c6 to 6a8e41f Compare April 7, 2025 21:47
@kaxil
kaxil requested a review from gopidesupavan as a code owner April 7, 2025 21:47
@kaxil
kaxil force-pushed the get-task-decorator-working branch 2 times, most recently from 36159c8 to 783f9ff Compare April 7, 2025 23:23
@kaxil
kaxil force-pushed the get-task-decorator-working branch from 783f9ff to 2e2db3d Compare April 8, 2025 00:27
@kaxil
kaxil merged commit 86d5b27 into apache:main Apr 8, 2025
@kaxil
kaxil deleted the get-task-decorator-working branch April 8, 2025 01:13
simonprydden pushed a commit to simonprydden/airflow that referenced this pull request Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make @task import from airflow.sdk

3 participants