Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(utils/decorators): rewrite remove task decorator to use cst #43383

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

josix
Copy link
Contributor

@josix josix commented Oct 25, 2024

due to #42766 the dropping of python3.8 support, I rewrite the remove_task_decorator to achieve the same purpose through CST.

TODO:

  • implementation
  • update unit tests

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

@josix josix force-pushed the refactor/remove_task_decorator branch 2 times, most recently from 991cccc to 4e926d5 Compare October 25, 2024 16:02
@josix josix marked this pull request as ready for review October 25, 2024 16:14
@josix josix marked this pull request as draft October 25, 2024 16:18
@Lee-W Lee-W self-requested a review October 25, 2024 16:19
@josix josix force-pushed the refactor/remove_task_decorator branch 2 times, most recently from d5e6684 to 606b2ea Compare October 25, 2024 20:02
@josix josix force-pushed the refactor/remove_task_decorator branch from 1ec8a0a to 28d8f2c Compare October 26, 2024 03:45
@josix josix marked this pull request as ready for review October 26, 2024 05:09
@Lee-W Lee-W marked this pull request as draft November 26, 2024 07:13
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

As we decide to use CST, just mark it as draft

@josix josix force-pushed the refactor/remove_task_decorator branch from 28d8f2c to 2a82c10 Compare December 16, 2024 16:58
@josix josix force-pushed the refactor/remove_task_decorator branch from 2a82c10 to f2cbefa Compare December 28, 2024 14:46
@josix josix force-pushed the refactor/remove_task_decorator branch 4 times, most recently from 292076c to 066d757 Compare January 27, 2025 07:28
@@ -192,25 +192,25 @@ def test_should_create_virtualenv_with_extra_packages_uv(self, mock_execute_in_s
)

def test_remove_task_decorator(self):
py_source = '@task.virtualenv(serializer="dill")\ndef f():\nimport funcsigs'
py_source = '@task.virtualenv(serializer="dill")\ndef f():\n import funcsigs'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note. the original syntax is invalid due to the indentation error.

@josix josix marked this pull request as ready for review January 27, 2025 08:22
@josix josix force-pushed the refactor/remove_task_decorator branch from 066d757 to 324301b Compare January 27, 2025 13:29
@josix
Copy link
Contributor Author

josix commented Jan 27, 2025

Hi @potiuk @Lee-W sorry for waiting for a period of time, I've updated to use libcst version to remove the task decorators. Please take a look when you are available, thanks!

@josix josix changed the title refactor(utils/decorators): rewrite remove task decorator to use ast refactor(utils/decorators): rewrite remove task decorator to use cst Jan 28, 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.

4 participants