You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "AronsonDan (via GitHub)" <gi...@apache.org> on 2024/07/04 13:19:44 UTC
[I] Expended parameters are rendered as MappedArgument [airflow]
AronsonDan opened a new issue, #40604:
URL: https://github.com/apache/airflow/issues/40604
### Apache Airflow version
Other Airflow 2 version (please specify below)
### If "Other Airflow 2 version" selected, which one?
2.9.0
### What happened?
When trying to expand a task group the following way:
```python
copy_into_postgres_by_company_task = (
copy_into_postgres_by_company_task_group.partial(table_name="table_name",
s3_bucket="s3_bucket",
aws_region="aws_region", ).expand(
company_id=['1', '2', '3']
))
```
and inside the task group trying to use company ID the following way:
```python
@task_group(group_id="task_group",
prefix_group_id=False)
def copy_into_postgres_by_company_task_group(*,
company_id: str,
table_name="table_name",
s3_bucket="s3_bucket",
aws_region: str = "aws_region",
postgres_conn_id: str = "postgres_default"):
create_postgres_temp_table_destination = SQLExecuteQueryOperator(
task_id="create_postgres_temp_table_destination_task",
conn_id=postgres_conn_id,
sql="sql/create_postgres_temp_table_per_company_query.sql",
parameters={"table_name": f"{table_name}_temp_{company_id}", }
)
```
The parameter is rendered the following way:
```python
{'table_name': "inventory_transactions_temp_MappedArgument(_input=DictOfListsExpandInput(value={'company_id': XComArg(<Task(_PythonDecoratedOperator): prepare_company_ids>)}), _key='company_id')"}
```
### What you think should happen instead?
I would hav expected parameters to render as:
```python
{'table_name': "inventory_transactions_temp_1"}
{'table_name': "inventory_transactions_temp_2"}
{'table_name': "inventory_transactions_temp_3"}
```
### How to reproduce
create the following DAG:
```python
@dag(
dag_id="kukuriku",
)
def kukuriku():
copy_into_postgres_by_company_task = (
copy_into_postgres_by_company_task_group.partial(table_name="table_name",
s3_bucket="s3_bucket",
aws_region="aws_region", ).expand(
company_id=['1', '2', '3']
))
```
### Operating System
Linux
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [X] 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] Expended parameters are rendered as MappedArgument [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #40604: Expended parameters are rendered as MappedArgument
URL: https://github.com/apache/airflow/issues/40604
--
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] Expended parameters are rendered as MappedArgument [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #40604:
URL: https://github.com/apache/airflow/issues/40604#issuecomment-2208975709
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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