Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def execute(self, context: Context) -> None:
job_id=self.job_id,
aws_conn_id=self.aws_conn_id,
region_name=self.region_name,
verify=self.verify,
botocore_config=self.botocore_config,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would advise you to run the prek hook locally to catch formatting errors like this.

waiter_delay=int(self.poke_interval),
waiter_max_attempts=self.max_retries,
),
Expand Down
22 changes: 22 additions & 0 deletions providers/amazon/tests/unit/amazon/aws/sensors/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ def test_execute_in_deferrable_mode(self, deferrable_batch_sensor: BatchSensor):
deferrable_batch_sensor.execute({})
assert isinstance(exc.value.trigger, BatchJobTrigger), "Trigger is not a BatchJobTrigger"

def test_execute_in_deferrable_mode_passes_aws_configs(self):
"""Asserts that verify and botocore_config survive into the serialized trigger payload."""
sensor = BatchSensor(
task_id="task",
job_id=JOB_ID,
region_name=AWS_REGION,
verify="/custom/ca_bundle.pem",
botocore_config={"read_timeout": 45},
deferrable=True,
)

with pytest.raises(TaskDeferred) as exc:
sensor.execute({})

trigger = exc.value.trigger
assert isinstance(trigger, BatchJobTrigger)

_, kwargs = trigger.serialize()
assert kwargs.get("region_name") == AWS_REGION
assert kwargs.get("verify") == "/custom/ca_bundle.pem"
assert kwargs.get("botocore_config") == {"read_timeout": 45}

@SameerMesiah97 SameerMesiah97 Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think it is necessary to cover region_name as my understanding is that the intention of this PR is to forward the 2 additional arguments i.e. verify and botocore_config.


def test_execute_failure_in_deferrable_mode(self, deferrable_batch_sensor: BatchSensor):
"""Tests that an AirflowException is raised in case of error event"""

Expand Down
Loading