GitHub user beschmitt closed a discussion: How to modify data before passing it
from one task to the other
Hello,
I have the following example problem using the pythonic way of writing DAGs
```
@dag(
dag_id = "executor",
params = {
"parameter1": Param(type="object"),
"parameter2": Param(type="object")
}
def executor():
@task
def extract_input(**kwargs) ->dict:
executor_input = kwargs["params"]
return executor_input
@task
def print_input(components: dict):
logging_client = components["logging_client"]
logging_client.info(components["parameter1"]
logging_client.info(components["parameter2"]
return True
input = extract_input()
logging_client = AirflowLoggingClient()
input["logging_client"] = logging_client
print_input(input)
executor()
```
I need to be able to use the output from my tasks to create different inputs
for other tasks, however I am stuck since all the outputs are of the type
`airflow.sdk.definitions.xcom_arg.PlainXComArg` and this class doesn't allow me
to do anything.
I have tried several things from the documentation and other questions like
using .output but this also does not exist for this class. I am really stuck in
how I am supposed to create anything in Apache Airflow, especially since the
new version has come out recently and all the documentation I can find
describes things that no longer work.
I have also tried to have a task that returns two variables and set
`@task(multiple_outputs=True)` but apparently that setting also doesn't exist
anymore.
Is my use-case of accessing the task-output in this way incorrect?
Does Apache Airflow only work if the exact output of my first task is the input
of the second task?
Any help would be welcome.
Best wishes
Benedikt
GitHub link: https://github.com/apache/airflow/discussions/49947
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]