Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
CompletionItemStatus,
CompletionOutcome,
CompletionStatus,
DistributedMapItemStatus,
DistributedMapStatus,
ParallelBranch,
complete_batch,
continue_batch,
Expand All @@ -27,6 +29,20 @@
durable_wait_for_callback,
durable_with_child_context,
)
from aws_durable_execution_sdk_python.dmap.helpers import (
DistributedMapProcessorEvent,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exported DistributedMapProcessorEvent is a parsed internal form, not the dictionary Lambda passes to the processor handler. Passing it to process_distributed_map_items() raises AttributeError: 'DistributedMapProcessorEvent' object has no attribute 'get'. Can __init__.py stop exporting DistributedMapProcessorEvent?

DistributedMapProcessorRecord,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exported DistributedMapProcessorRecord is the parsed internal form of one record dictionary. Only DistributedMapProcessorEvent.from_dict() constructs it, and no public function accepts it. No customer callback receives a record either. The item callbacks receive the deserialized item and a DistributedMapItemContext, and the batch callback receives the list of deserialized items and a DistributedMapBatchContext. Every name in __all__ is public API, so this export makes the record fields and parsing public even though customers have no use for them. Can __init__.py stop exporting DistributedMapProcessorRecord?

DistributedMapReaderEvent,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exported DistributedMapReaderEvent is a parsed internal form, not the dictionary Lambda passes to the reader handler. Passing it to read_distributed_map_page() raises AttributeError because DistributedMapReaderEvent.from_dict() calls .get() on its argument. Can __init__.py stop exporting DistributedMapReaderEvent?

ReaderPage,
process_distributed_map_batch,
process_distributed_map_items,
read_distributed_map_page,
)
from aws_durable_execution_sdk_python.dmap.models import (
DistributedMapResult,
DistributedMapResultItem,
DistributedMapSummary,
)

# Most common exceptions - users need to handle these exceptions
from aws_durable_execution_sdk_python.exceptions import (
Expand All @@ -35,6 +51,7 @@
CallbackSubmitterError,
CallbackTimeoutError,
ChildContextError,
DistributedMapError,
DurableExecutionsError,
DurableOperationError,
ExecutionError,
Expand All @@ -53,7 +70,12 @@
from aws_durable_execution_sdk_python.retries import WithRetryConfig, with_retry

# Essential context types - passed to user functions
from aws_durable_execution_sdk_python.types import StepContext
from aws_durable_execution_sdk_python.types import (
DistributedMapBatchContext,
DistributedMapItemContext,
DistributedMapReaderContext,
StepContext,
)


__all__ = [
Expand All @@ -69,6 +91,18 @@
"CompletionItemStatus",
"CompletionOutcome",
"CompletionStatus",
"DistributedMapBatchContext",
"DistributedMapError",
"DistributedMapItemContext",
"DistributedMapItemStatus",
"DistributedMapProcessorEvent",
"DistributedMapProcessorRecord",
"DistributedMapReaderContext",
"DistributedMapReaderEvent",
"DistributedMapResult",
"DistributedMapResultItem",
"DistributedMapStatus",
"DistributedMapSummary",
"DurableContext",
"DurableExecutionsError",
"DurableOperationError",
Expand All @@ -77,6 +111,7 @@
"InvokeError",
"ParallelBranch",
"PluginLoadError",
"ReaderPage",
"RetryableSerDesError",
"SerDesError",
"StepContext",
Expand All @@ -92,5 +127,8 @@
"durable_step",
"durable_wait_for_callback",
"durable_with_child_context",
"process_distributed_map_batch",
"process_distributed_map_items",
"read_distributed_map_page",
"with_retry",
]
Loading
Loading