ephraimbuddy opened a new pull request, #23486:
URL: https://github.com/apache/airflow/pull/23486
When task is expanded from a mapped task that returned no value, it
crashes the scheduler. This PR fixes it by first checking if there's
a return value from the mapped task, if no returned value, then error
in the task itself instead of crashing the scheduler
Can be tested with:
```python
from airflow import DAG
from airflow.decorators import task
from airflow.operators.bash import BashOperator
from datetime import datetime
import random
with DAG(dag_id='my_dag', start_date=datetime(2022, 1, 1),
schedule_interval='@daily', catchup=False) as dag:
@task
def get_files():
return [f"file_{nb}" for nb in range(random.randint(3, 5))]
@task
def download_files(folder: str, file: str):
print(f"{folder}/{file}")
files =
download_files.partial(folder='/usr/local').expand(file=get_files())
BashOperator.partial(task_id="ls_file").expand(bash_command=files)
```
--
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]