Skip to content

Commit d9ff4e5

Browse files
committed
fix: Import concrete BatchResult
Previously, context.py imported BatchResult from the types module, which only exposed the Protocol interface with the get_results() method. This prevented client-side type checkers and IDEs from discovering the full set of methods available on BatchResult objects returned by map() and parallel() operations. Changed to import the concrete BatchResult class from concurrency.models, which exposes all available methods including: - throw_if_error() - succeeded(), failed(), started() - has_failure, status properties - success_count, failure_count, started_count properties - get_errors() This improves developer experience by providing accurate type hints and autocomplete for all BatchResult methods without introducing circular dependencies.
1 parent 6ac4feb commit d9ff4e5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/aws_durable_execution_sdk_python/context.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@
4444
)
4545
from aws_durable_execution_sdk_python.state import ExecutionState # noqa: TCH001
4646
from aws_durable_execution_sdk_python.threading import OrderedCounter
47+
from aws_durable_execution_sdk_python.types import Callback as CallbackProtocol
48+
from aws_durable_execution_sdk_python.types import (
49+
DurableContext as DurableContextProtocol,
50+
)
4751
from aws_durable_execution_sdk_python.types import (
48-
BatchResult,
4952
LoggerInterface,
5053
StepContext,
5154
WaitForCallbackContext,
5255
WaitForConditionCheckContext,
5356
)
54-
from aws_durable_execution_sdk_python.types import Callback as CallbackProtocol
55-
from aws_durable_execution_sdk_python.types import (
56-
DurableContext as DurableContextProtocol,
57-
)
5857

5958
if TYPE_CHECKING:
6059
from collections.abc import Callable, Sequence
6160

61+
from aws_durable_execution_sdk_python.concurrency.models import BatchResult
6262
from aws_durable_execution_sdk_python.state import CheckpointedResult
6363
from aws_durable_execution_sdk_python.types import LambdaContext
6464
from aws_durable_execution_sdk_python.waits import WaitForConditionConfig

0 commit comments

Comments
 (0)