raphaelauv commented on issue #43433:
URL: https://github.com/apache/airflow/issues/43433#issuecomment-2453556417
hey , using "array" change my value(array) to a string in another array
`['[{"toto": 5}]']`
```python
from airflow.models import Param
from airflow.operators.python import PythonOperator
from pendulum import today
from airflow import DAG
with DAG(
dag_id="a",
schedule_interval=None,
start_date=today("UTC").add(days=-1),
params={
"x": Param([], type="array"),
}
):
def a(toto):
print(toto)
print(type(toto))
PythonOperator(task_id="toto", python_callable=a, op_kwargs={"toto":
"{{params.x}}"})
```
so I must use `string` until a better support
```python
with DAG(
dag_id="a",
schedule_interval=None,
start_date=today("UTC").add(days=-1),
params={
"x": Param(None, type="string"),
}
):
def a(toto):
toto = json.loads(toto)
print(toto)
PythonOperator(task_id="toto", python_callable=a, op_kwargs={"toto":
"{{params.x}}"})
```
--
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]