Skip to content
Merged
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
8 changes: 8 additions & 0 deletions providers/amazon/docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
Changelog
---------

.. warning::
The default waiter timeout of ``ComprehendCreateDocumentClassifierOperator`` was raised from
20 minutes (``waiter_max_attempts=20``) to 60 minutes (``waiter_max_attempts=60``), because
document classifier training sometimes takes longer than 20 minutes. When the operator waits
for completion (the default, in both synchronous and deferrable mode), tasks that previously
failed with a waiter timeout around the 20-minute mark now keep waiting for up to an hour.
Pass ``waiter_max_attempts`` explicitly to restore the previous timeout.

9.35.1
......

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class ComprehendCreateDocumentClassifierOperator(AwsBaseOperator[ComprehendHook]

:param wait_for_completion: Whether to wait for job to stop. (default: True)
:param waiter_delay: Time in seconds to wait between status checks. (default: 60)
:param waiter_max_attempts: Maximum number of attempts to check for job completion. (default: 20)
:param waiter_max_attempts: Maximum number of attempts to check for job completion. (default: 60)
:param deferrable: If True, the operator will wait asynchronously for the job to stop.
This implies waiting for completion. This mode requires aiobotocore module to be installed.
(default: False)
Expand Down Expand Up @@ -285,7 +285,7 @@ def __init__(
document_classifier_kwargs: dict[str, Any] | None = None,
wait_for_completion: bool = True,
waiter_delay: int = 60,
waiter_max_attempts: int = 20,
waiter_max_attempts: int = 60,
deferrable: bool = conf.getboolean("operators", "default_deferrable", fallback=False),
**kwargs,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def document_classifier_workflow():
document_classifier_kwargs=document_classifier_kwargs,
)
# [END howto_operator_create_document_classifier]
create_document_classifier.wait_for_completion = False

# [START howto_sensor_create_document_classifier]
await_create_document_classifier = ComprehendCreateDocumentClassifierCompletedSensor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ def test_init(self):
assert self.operator.language_code == "en"
assert self.operator.document_classifier_kwargs == {"VersionName": "v1"}
assert self.operator.fail_on_warnings is False
assert self.operator.waiter_delay == 60
assert self.operator.waiter_max_attempts == 60

@mock.patch.object(ComprehendHook, "conn")
def test_create_document_classifier(self, mock_conn):
Expand Down
Loading