komatibhuvana opened a new pull request, #76496:
URL: https://github.com/apache/airflow/pull/76496

   The MWAA Serverless 
[`CreateWorkflow`](https://docs.aws.amazon.com/mwaa-serverless/latest/APIReference/API_CreateWorkflow.html#mwaaserverless-CreateWorkflow-request-Environment)
 and 
[`UpdateWorkflow`](https://docs.aws.amazon.com/mwaa-serverless/latest/APIReference/API_UpdateWorkflow.html#mwaaserverless-UpdateWorkflow-request-Environment)
 APIs now accept an `Environment` field (`{"Variables": {str: str}}`) to set 
environment variables for tasks in a workflow.
   
   This PR exposes it as a templated `environment_variables: dict[str, str] | 
None` parameter on:
   
   - `MwaaServerlessCreateWorkflowOperator`
   - `MwaaServerlessUpdateWorkflowOperator`
   
   When set, the operator sends `Environment={"Variables": 
environment_variables}`; when `None` (default) the field is omitted, so 
existing behavior is unchanged. An explicit `{}` is passed through, which on 
update clears the workflow's variables. As the API docs note, on 
`UpdateWorkflow` the supplied variables replace all existing ones, which is 
called out in the docstring.
   
   ```python
   MwaaServerlessCreateWorkflowOperator(
       task_id="create_workflow",
       workflow_name="my-workflow",
       definition_s3_location={"Bucket": "my-bucket", "ObjectKey": 
"workflow.yaml"},
       role_arn="arn:aws:iam::123456789012:role/my-role",
       environment_variables={"ENV": "prod", "LOG_LEVEL": "INFO"},
   )
   ```
   
   **botocore note:** `Environment` first appears in the `mwaa-serverless` 
service model in botocore **1.43.124** (verified 1.43.117–1.43.123 do not 
include it). I did not bump the provider's `botocore>=1.43.4` floor since 
floors are raised via `breeze ci upgrade`; using the new parameter with an 
older botocore raises a `ParamValidationError`, and the requirement is noted in 
the docstrings. Happy to bump the floor here if maintainers prefer.
   
   **Tests:** added unit tests for both operators (including the empty-dict 
case on update); `test_mwaa_serverless.py` passes (25 tests), and prek static 
checks pass.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Claude Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to