uranusjr commented on issue #23803:
URL: https://github.com/apache/airflow/issues/23803#issuecomment-1131959817
If I understand correctly, this is totally possible with the current syntax
to achieve what you want, except you need to zip and unpack manually.
```python
@task
def zip_params(params):
return zip(params["arg1"], params["arg2"])
@task
def run_task(param):
arg1, arg2 = param
print(arg1, arg2)
with DAG(dag_id="airflow_fun", start_date=datetime(2022, 5, 16)):
p = zip_params(get_params())
run_task.expand(param=p)
```
I do agree it would be useful to provide methods for common functional
operations, however, and perhaps even support user-registered custom operators.
The syntax I have in mind is something like
```python
with DAG(...):
params = get_params().map(lambda p: (p["arg1"], p["arg2"])).zip()
run_task.expand(arg1=params[0], arg2=params[1])
```
--
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]