You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "atul-astronomer (via GitHub)" <gi...@apache.org> on 2025/04/01 11:38:55 UTC

[I] Task callbacks are failing for taskmap Dags [airflow]

atul-astronomer opened a new issue, #48621:
URL: https://github.com/apache/airflow/issues/48621

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   [2025-04-01, 11:25:53] ERROR - Top level error: source="task"
   TypeError: 'NoneType' object is not iterable
   File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/task_runner.py", line 1056 in main
   
   File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/task_runner.py", line 1016 in finalize
   
   File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/task_runner.py", line 864 in _run_task_state_change_callbacks
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Run the below Dag:
   
   ```python
   with DAG(
       dag_id="expand_kwargs_mod_tf",
       doc_md="use expand_kwargs with a mapper function and the taskflow interface",
       schedule=timedelta(days=30 * 365),
       start_date=datetime(1970, 1, 1),
       tags=["taskmap"]
   ) as expand_kwargs_mod_tf:
   
       @task
       def data():
           return [
               ("hello {}", "foo"),
               ("goodbye {}", "bar"),
           ]
   
       def mapper(entry):
           print("ENTRY: ", entry)
           if entry[1] != "bar":
               return {"template": entry[0], "user": entry[1]}
           else:
               raise AirflowSkipException("no entry for foo")
   
       @task(task_id="one_task")
       def printer(template, user):
           print(template.format(user))
   
       printer.expand_kwargs(data().map(mapper))
   ``` 
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.apache.org

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


Re: [I] Task callbacks are failing for taskmap Dags [airflow]

Posted by "atul-astronomer (via GitHub)" <gi...@apache.org>.
atul-astronomer commented on issue #48621:
URL: https://github.com/apache/airflow/issues/48621#issuecomment-2771394898

   @tirkarthi added the import statements.


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


Re: [I] Task callbacks are failing for taskmap Dags [airflow]

Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on issue #48621:
URL: https://github.com/apache/airflow/issues/48621#issuecomment-2769215571

   Ttask level callbacks were implemented in 6d0e00c73c0 . From my understanding these can be `None` or a single function so `getattr` which could be returning `None` fails .
   
   https://github.com/apache/airflow/blob/e9cc14808b0f91c33309fe0842e5c8375ec2122f/task-sdk/src/airflow/sdk/bases/operator.py#L233-L252
   
   https://github.com/apache/airflow/blob/e9cc14808b0f91c33309fe0842e5c8375ec2122f/task-sdk/src/airflow/sdk/execution_time/task_runner.py#L863-L864
   
   cc: @uranusjr 
   
   @atul-astronomer If you can post the full dag file with imports it will be easier to copy, paste and run them. Thanks.
   


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


Re: [I] Task callbacks are failing for taskmap Dags [airflow]

Posted by "phanikumv (via GitHub)" <gi...@apache.org>.
phanikumv closed issue #48621: Task callbacks are failing for taskmap Dags
URL: https://github.com/apache/airflow/issues/48621


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


Re: [I] Task callbacks are failing for taskmap Dags [airflow]

Posted by "atul-astronomer (via GitHub)" <gi...@apache.org>.
atul-astronomer commented on issue #48621:
URL: https://github.com/apache/airflow/issues/48621#issuecomment-2772103521

   Retested, working fine.


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