Skip to content

Commit e49c6dd

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

15 files changed

+33
-57
lines changed

durabletask/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4+
# Public async exports (import directly from durabletask.aio)
5+
from durabletask.aio import AsyncWorkflowContext, CoroutineOrchestratorRunner # noqa: F401
6+
47
"""Durable Task SDK for Python"""
58

69
PACKAGE_NAME = 'durabletask'
7-
8-
# Public async exports (import directly from durabletask.aio)
9-
from durabletask.aio import ( # noqa: F401
10-
AsyncWorkflowContext,
11-
CoroutineOrchestratorRunner,
12-
)

durabletask/client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,6 @@ def wait_for_orchestration_completion(
240240
OrchestrationStatus.FAILED,
241241
OrchestrationStatus.TERMINATED,
242242
]:
243-
print(
244-
f'[CLIENT DEBUG] Orchestration {instance_id} already in terminal state: {current_state.runtime_status}'
245-
)
246243
return current_state
247244

248245
# Poll for completion with exponential backoff to handle eventual consistency

durabletask/internal/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ def new_complete_orchestration_action(
218218
)
219219

220220
return pb.OrchestratorAction(
221-
id=id, completeOrchestration=completeOrchestrationAction,
222-
router=pb.TaskRouter(sourceAppID=app_id) if app_id else None
221+
id=id,
222+
completeOrchestration=completeOrchestrationAction,
223+
router=pb.TaskRouter(sourceAppID=app_id) if app_id else None,
223224
)
224225

225226

durabletask/worker.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -860,17 +860,7 @@ def resume(self):
860860
# This will either return a Task or raise StopIteration if it's done.
861861
try:
862862
_val = self._previous_task.get_result()
863-
import os as _os
864-
865-
if _os.getenv('DAPR_WF_DEBUG') or _os.getenv('DT_DEBUG'):
866-
print(
867-
f'[DT] resume send instance={self._instance_id} type={type(_val)} is_none={_val is None}'
868-
)
869-
except Exception as _e:
870-
import os as _os
871-
872-
if _os.getenv('DAPR_WF_DEBUG') or _os.getenv('DT_DEBUG'):
873-
print(f'[DT] resume send error instance={self._instance_id} err={_e}')
863+
except Exception:
874864
raise
875865
next_task = self._generator.send(_val)
876866

@@ -901,7 +891,9 @@ def set_complete(
901891
if result is not None:
902892
result_json = result if is_result_encoded else shared.to_json(result)
903893
action = ph.new_complete_orchestration_action(
904-
self.next_sequence_number(), status, result_json,
894+
self.next_sequence_number(),
895+
status,
896+
result_json,
905897
app_id=self._app_id,
906898
)
907899
self._pending_actions[action.id] = action
@@ -1445,16 +1437,6 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven
14451437
result = None
14461438
if not ph.is_empty(event.taskCompleted.result):
14471439
result = shared.from_json(event.taskCompleted.result.value)
1448-
try:
1449-
import os as _os
1450-
1451-
if _os.getenv('DAPR_WF_DEBUG') or _os.getenv('DT_DEBUG'):
1452-
print(
1453-
f'[DT] taskCompleted decode instance={ctx.instance_id} task_id={task_id} type={type(result)} is_none={result is None}'
1454-
)
1455-
print(f'[DT] pending_task_present={activity_task is not None}')
1456-
except Exception:
1457-
pass
14581440
activity_task.complete(result)
14591441
ctx.resume()
14601442
elif event.HasField('taskFailed'):

examples/async_non_determinism_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010
import time
1111
import warnings
12-
from datetime import datetime
1312

1413
from durabletask.aio import SandboxMode
1514
from durabletask.client import TaskHubGrpcClient

tests/aio/compatibility_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from unittest.mock import Mock
1919

2020
from durabletask import task
21-
from durabletask.aio.compatibility import OrchestrationContextProtocol
2221

2322

2423
class CompatibilityChecker:

tests/aio/test_async_orchestrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def test_async_when_any_ignores_losers_deterministically():
353353
async def orch(ctx, _):
354354
a = ctx.activity('a', input=1)
355355
b = ctx.activity('b', input=2)
356-
_winner = await ctx.when_any([a, b])
356+
await ctx.when_any([a, b])
357357
return 'done'
358358

359359
def a(_, x):

tests/aio/test_asyncio_compat_enhanced.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
import asyncio
66
import os
7-
import time
8-
from datetime import datetime, timedelta
7+
from datetime import datetime
98
from unittest.mock import Mock, patch
109

1110
import pytest
@@ -114,7 +113,7 @@ def test_activity_logging(self):
114113
with patch.dict(os.environ, {'DAPR_WF_DEBUG': 'true'}):
115114
ctx = AsyncWorkflowContext(self.mock_base_ctx)
116115

117-
awaitable = ctx.activity('test_activity', input='test')
116+
ctx.activity('test_activity', input='test')
118117

119118
assert len(ctx._operation_history) == 1
120119
op = ctx._operation_history[0]
@@ -126,7 +125,7 @@ def test_sleep_logging(self):
126125
with patch.dict(os.environ, {'DAPR_WF_DEBUG': 'true'}):
127126
ctx = AsyncWorkflowContext(self.mock_base_ctx)
128127

129-
awaitable = ctx.sleep(5.0)
128+
ctx.sleep(5.0)
130129

131130
assert len(ctx._operation_history) == 1
132131
op = ctx._operation_history[0]

tests/aio/test_context.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Tests for AsyncWorkflowContext in durabletask.aio.
66
"""
77

8-
import inspect
98
import random
109
import uuid
1110
from datetime import datetime, timedelta

tests/aio/test_context_compatibility.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212

1313
import inspect
1414
from datetime import datetime, timedelta
15-
from typing import Any, Optional, Union
1615
from unittest.mock import Mock
1716

1817
import pytest
1918

2019
from durabletask import task
2120
from durabletask.aio import AsyncWorkflowContext
2221

23-
from .compatibility_utils import CompatibilityChecker
24-
2522

2623
class TestAsyncWorkflowContextCompatibility:
2724
"""Test suite to validate AsyncWorkflowContext compatibility with OrchestrationContext."""

0 commit comments

Comments
 (0)