LE0-Lin commented on code in PR #72472:
URL: https://github.com/apache/airflow/pull/72472#discussion_r3932453157
##########
providers/amazon/tests/unit/amazon/aws/sensors/test_opensearch_serverless.py:
##########
@@ -57,6 +57,30 @@ def test_base_aws_op_attributes(self):
assert op.hook._config is not None
assert op.hook._config.read_timeout == 42
+ def test_deferrable_sensor_forwards_aws_configuration(self):
+ sensor = OpenSearchServerlessCollectionActiveSensor(
+ **self.default_op_kwargs,
+ deferrable=True,
+ aws_conn_id="test_conn",
+ region_name="eu-west-1",
+ verify=False,
+ botocore_config={"read_timeout": 42},
+ )
+
+ with pytest.raises(TaskDeferred) as deferred:
+ sensor.execute(None)
+
+ assert deferred.value.trigger.serialize()[1] == {
+ "collection_id": "knowledge_base_id",
+ "collection_name": None,
+ "waiter_delay": 5,
+ "waiter_max_attempts": 1,
+ "aws_conn_id": "test_conn",
+ "region_name": "eu-west-1",
+ "verify": False,
+ "botocore_config": {"read_timeout": 42},
+ }
Review Comment:
Thanks for the suggestion. I agreed that asserting the full dictionary was
broader than needed and narrowed the test to the three configuration fields in
e759ea91. I kept the assertions on the serialized payload rather than the
trigger attributes because #72280 specifically asks us to verify that these
values survive deferral serialization; this keeps the regression test focused
on the bug while avoiding coupling to unrelated arguments.
--
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]