amoghrajesh commented on PR #44843:
URL: https://github.com/apache/airflow/pull/44843#issuecomment-2538393429

   FYI, I ran the DAG from ash that found this issue:
   ```
   from __future__ import annotations
   
   import sys
   import time
   from datetime import datetime
   
   from airflow.decorators import dag, task
   
   
   @dag(
       # every minute on the 30-second mark
       catchup=False,
       tags=[],
       schedule=None,
       start_date=datetime(2021, 1, 1),
   )
   def hello_dag():
       """
       ### TaskFlow API Tutorial Documentation
       This is a simple data pipeline example which demonstrates the use of
       the TaskFlow API using three simple tasks for Extract, Transform, and 
Load.
       Documentation that goes along with the Airflow TaskFlow API tutorial is
       located
       
[here](https://airflow.apache.org/docs/apache-airflow/stable/tutorial_taskflow_api.html)
       """
   
       @task()
       def hello():
           print("hello")
           time.sleep(3)
           print("goodbye")
           print("err mesg", file=sys.stderr)
   
       hello()
   
   
   hello_dag()
   
   ```
   
   
   using this UT:
   ```
   def test_startup_dag_with_no_templates_mixed_types(mocked_parse, 
test_dags_dir):
       """Test startup of a simple DAG."""
       what = StartupDetails(
           ti=TaskInstance(id=uuid7(), task_id="hello", dag_id="hello_dag", 
run_id="c", try_number=1),
           file=str(test_dags_dir / "mydag.py"),
           requests_fd=0,
       )
       ti  = parse(what)
   
       with mock.patch(
           "airflow.sdk.execution_time.task_runner.SUPERVISOR_COMMS", 
create=True
       ) as mock_supervisor_comms:
           mock_supervisor_comms.get_message.return_value = what
           startup()
           run(ti, log=mock.ANY)
   
   ```
   
   Result:
   ```
   Home of the user: /Users/amoghdesai
   Airflow home /Users/amoghdesai/airflow
   PASSED [100%][2024-12-12T15:16:57.104+0530] {dagbag.py:535} INFO - Filling 
up the DagBag from 
/Users/amoghdesai/Documents/OSS/airflow/task_sdk/tests/dags/mydag.py
   [2024-12-12T15:16:57.175+0530] {dagbag.py:535} INFO - Filling up the DagBag 
from /Users/amoghdesai/Documents/OSS/airflow/task_sdk/tests/dags/mydag.py
   2024-12-12 15:16:57 [debug    ] DAG file parsed                [task] 
file=/Users/amoghdesai/Documents/OSS/airflow/task_sdk/tests/dags/mydag.py
   hello
   goodbye
   [2024-12-12T15:17:00.178+0530] {python.py:197} INFO - Done. Returned value 
was: None
   ```


-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to