TAKEDA-Takashi commented on PR #63400:
URL: https://github.com/apache/airflow/pull/63400#issuecomment-4051384851
Thank you for the feedback, @eladkal.
I tested render_template_as_native_obj (from #60619) on MWAA Serverless with
the following YAML workflow definition:
```yaml
tasks:
get_config:
operator:
airflow.providers.amazon.aws.operators.lambda_function.LambdaInvokeFunctionOperator
task_id: get_config
function_name: my-function
payload: '{}'
publish_result:
operator: airflow.providers.amazon.aws.operators.sqs.SqsPublishOperator
task_id: publish_result
sqs_queue: https://sqs.us-east-1.amazonaws.com/123456789012/my-queue
render_template_as_native_obj: true
message_content: >-
{"bucket":"{{ ti.xcom_pull(task_ids='get_config')['data_bucket'] }}"}
dependencies:
- get_config
```
Result: FAILED. The ['data_bucket'] access still raises a runtime error
because the XCom value remains a string.
I also confirmed that even without bracket access (just {{
ti.xcom_pull(task_ids='get_config') }}), the output is identical with or
without render_template_as_native_obj: true — the XCom value is not
deserialized into a native type.
It appears that MWAA Serverless either ignores or does not support the
render_template_as_native_obj parameter in its YAML workflow engine.
Given that:
- MWAA Serverless only supports YAML workflow definitions (no Python DAGs)
- PythonOperator is not available for post-processing XCom values
- Subclassing operators is not possible in YAML definitions
- render_template_as_native_obj has no effect in this environment
The deserialize_payload parameter on the operator itself is the only viable
solution for this use case. It's also a minimal, backward-compatible change (2
lines in execute()) that benefits standard Airflow users who currently need an
extra task or custom subclass to parse Lambda responses.
--
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]