josh-fell commented on PR #22941:
URL: https://github.com/apache/airflow/pull/22941#issuecomment-1098075682
FWIW what @uranusjr proposed can already be done (at least with 2.2.5) which
I didn't realize:
```python
from pendulum import datetime
from airflow.decorators import dag, task
def hello(name):
print("hello " + name)
@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def something():
task(hello, task_id="something_else")(name="is there anybody out there?")
_ = something()
```
<img width="761" alt="image"
src="https://user-images.githubusercontent.com/48934154/163194131-35636cb7-c3f8-4bd2-9d69-cb1ebb8dd44d.png">
I'd prefer this actually. This way if I can still keep these functions
separate and not need to have Airflow code in the function module itself to
turn the function into a task. I'm not sure with `.override()` if users _might_
think that the `.override()` call is applied to the decorated function rather
than the decorator itself. Perhaps I'm also overthinking this though.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]