You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ephraimbuddy (via GitHub)" <gi...@apache.org> on 2023/04/03 16:45:54 UTC
[GitHub] [airflow] ephraimbuddy opened a new pull request, #30442: Allow setup/teardown task decorators to take same args as task decorators
ephraimbuddy opened a new pull request, #30442:
URL: https://github.com/apache/airflow/pull/30442
The setup/teardown decorators should take same arguments as task decorators. In the event that both task decorator and setup/teardown decorator are given the same args, the arg on the setup/teardown takes precedence. e.g if we have:
```python
@setup(task_id="setuptask")
@task(task_id="mytask")
def mytask2():
...
```
The task id would eventually be setuptask and not mytask.
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
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](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy closed pull request #30442: Allow setup/teardown task decorators to take same args as task decorators
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy closed pull request #30442: Allow setup/teardown task decorators to take same args as task decorators
URL: https://github.com/apache/airflow/pull/30442
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on pull request #30442: Allow setup/teardown task decorators to take same args as task decorators
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #30442:
URL: https://github.com/apache/airflow/pull/30442#issuecomment-1536359553
I'd prefer we don't do this actually, and instead consider this:
```python
@setup
def whatever():
...
```
to simply be a shortcut for:
```python
@setup
@task
def whatever():
...
```
And if you wanted to provide any kwargs to task, that you have to use both `@setup` and `@task` together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on pull request #30442: Allow setup/teardown task decorators to take same args as task decorators
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #30442:
URL: https://github.com/apache/airflow/pull/30442#issuecomment-1538006497
>
Makes sense.
cc @dstandish
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org