Skip to content

Commit c01d8b3

Browse files
committed
lint
Signed-off-by: Filinto Duran <[email protected]>
1 parent c513506 commit c01d8b3

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

durabletask/task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ class NonRetryableError(Exception):
244244

245245

246246
def is_error_non_retryable(error_type: str, policy: RetryPolicy) -> bool:
247-
""" Checks whether an error type is non-retryable."""
247+
"""Checks whether an error type is non-retryable."""
248248
is_non_retryable = False
249249
if error_type == "NonRetryableError":
250250
is_non_retryable = True
251251
elif (
252-
policy.non_retryable_error_types is not None
253-
and error_type in policy.non_retryable_error_types
252+
policy.non_retryable_error_types is not None
253+
and error_type in policy.non_retryable_error_types
254254
):
255255
is_non_retryable = True
256256
return is_non_retryable

durabletask/worker.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import durabletask.internal.shared as shared
2222
from durabletask import task
2323
from durabletask.internal.grpc_interceptor import DefaultClientInterceptorImpl
24-
from durabletask.task import RetryPolicy
2524

2625
TInput = TypeVar("TInput")
2726
TOutput = TypeVar("TOutput")
@@ -448,7 +447,7 @@ def stream_reader():
448447
else:
449448
self._logger.warning(f"Unexpected work item type: {request_type}")
450449
except grpc.RpcError:
451-
raise # let it be captured/parsed by outer except and avoid noisy log
450+
raise # let it be captured/parsed by outer except and avoid noisy log
452451
except Exception as e:
453452
self._logger.warning(f"Error in work item stream: {e}")
454453
raise e
@@ -1144,7 +1143,9 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven
11441143
if isinstance(activity_task, task.RetryableTask):
11451144
if activity_task._retry_policy is not None:
11461145
# Check for non-retryable errors by type name
1147-
if task.is_error_non_retryable(event.taskFailed.failureDetails.errorType, activity_task._retry_policy):
1146+
if task.is_error_non_retryable(
1147+
event.taskFailed.failureDetails.errorType, activity_task._retry_policy
1148+
):
11481149
activity_task.fail(
11491150
f"{ctx.instance_id}: Activity task #{task_id} failed: {event.taskFailed.failureDetails.errorMessage}",
11501151
event.taskFailed.failureDetails,
@@ -1219,7 +1220,9 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven
12191220
if isinstance(sub_orch_task, task.RetryableTask):
12201221
if sub_orch_task._retry_policy is not None:
12211222
# Check for non-retryable errors by type name
1222-
if task.is_error_non_retryable(failedEvent.failureDetails.errorType, sub_orch_task._retry_policy):
1223+
if task.is_error_non_retryable(
1224+
failedEvent.failureDetails.errorType, sub_orch_task._retry_policy
1225+
):
12231226
sub_orch_task.fail(
12241227
f"Sub-orchestration task #{task_id} failed: {failedEvent.failureDetails.errorMessage}",
12251228
failedEvent.failureDetails,

tests/durabletask/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from unittest.mock import patch, MagicMock
1+
from unittest.mock import MagicMock, patch
22

33
from durabletask.internal.grpc_interceptor import DefaultClientInterceptorImpl
44
from durabletask.internal.shared import get_default_host_address, get_grpc_channel

0 commit comments

Comments
 (0)