ephraimbuddy commented on PR #22941:
URL: https://github.com/apache/airflow/pull/22941#issuecomment-1098084428

   
   
   
   > 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 alt="image" width="761" 
src="https://user-images.githubusercontent.com/48934154/163194131-35636cb7-c3f8-4bd2-9d69-cb1ebb8dd44d.png";>
   > 
   > I'd prefer this actually. This way 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.
   
   I didn't realise that too. Happy to close this then 
   Cc: @uranusjr @ashb  WDYT?


-- 
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]

Reply via email to