Skip to content

Remove unused config types: ItemBatcher, BatchedInput, ItemsPerBatchUnit, TerminationMode, StepFuture #532

Description

@yaythomas

Summary

config.py exposes several types that are not wired into any operation. They accept user input and silently do nothing. This proposes removing them in v2, since removal changes the public config surface and is a breaking change.

Unused types

1. ItemBatcher, MapConfig.item_batcher, ItemsPerBatchUnit, BatchedInput

MapConfig.item_batcher is never read. MapExecutor.from_items (src/aws_durable_execution_sdk_python/operation/map.py) consumes every other MapConfig field but not item_batcher. Items are never batched.

  • ItemsPerBatchUnit has no consumers. It also contains a latent bug: COUNT = ("COUNT",) defines a tuple value due to a trailing comma, and tests/config_test.py asserts the tuple.
  • BatchedInput is never constructed. It appears only in the map callable type hint (U | BatchedInput[Any, U] in context.py and types.py), advertising batching that does not exist.
  • [Docs]: Map Operations - Batching items #304 confirmed the docs side: "ItemBatcher is not implemented yet and reserved for future use." The docs section was removed but the code remained.
  • The JS SDK has no batching concept. MapConfig in aws-durable-execution-sdk-js/src/types/batch.ts has no itemBatcher, and MapFunc is (context, item, index, array).

Proposed change: remove ItemBatcher, ItemsPerBatchUnit, BatchedInput, and MapConfig.item_batcher. Simplify the map callable signature to Callable[[DurableContext, U, int, Sequence[U]], T], matching JS MapFunc.

2. TerminationMode

Defined in config.py with values TERMINATE, CANCEL, WAIT, ABANDON. Zero references in src/ outside its own definition. The only usage is a value-assertion test in tests/config_test.py. Neither the JS SDK nor the Java SDK has an equivalent.

Proposed change: remove the enum and its test.

3. StepFuture

Defined in config.py. Zero references in src/ outside its own definition. It mirrors the JS DurablePromise, but the Python SDK's synchronous execution model never adopted it. The only usage is a shape test in tests/config_test.py.

Proposed change: remove the class and its tests.

4. ChildConfig.item_serdes

ChildConfig.item_serdes is never read. ChildOperationExecutor (src/aws_durable_execution_sdk_python/operation/child.py) consumes serdes, sub_type, summary_generator, and is_virtual but not item_serdes. The map/parallel call sites in context.py explicitly pass item_serdes=None into the ChildConfig they build, with a comment stating the child handler should only know the parent serdes.

  • The "Backward Compatibility: If only 'serdes' is provided..." paragraph in the ChildConfig docstring describes the item_serdes or serdes fallback that exists in the concurrency executor for map/parallel, not in the child executor. The docstring documents behavior the class does not have.
  • Neither of the other SDKs has the field. JS ChildConfig is serdes, subType, summaryGenerator, errorMapper, virtualContext. Java RunInChildContextConfig is serDes and isVirtual only.

Proposed change: remove ChildConfig.item_serdes and the stale backward-compatibility docstring paragraph.

Related: WaitStrategyConfig.timeout

WaitStrategyConfig (waits.py) carries a timeout field annotated "Not implemented yet". create_wait_strategy never reads it. Recommendation: delete the field rather than implement it, as part of the WaitStrategyConfig removal already proposed in #530.

  • There is no backend mechanism that could enforce it. The wait strategy is entirely client-side. On the wire, StepOptions carries only NextAttemptDelaySeconds and WaitOptions carries only WaitSeconds. Only callbacks have a backend-enforced TimeoutSeconds.
  • The strategy callable receives only (state, attempts_made), so a wall-clock implementation would require clock reads inside replayed code. A deterministic total-time cap reduces to what max_attempts plus bounded backoff already provides.
  • The Java SDK has no such field. WaitStrategies.exponentialBackoff and fixedDelay bound polling by attempts only.
  • The JS SDK carries the identical unimplemented field (timeoutSeconds in utils/wait-strategy/wait-strategy-config.ts, commented "not implemented in this version"). It should be removed there too for three-SDK consistency. This is being raised with the JS SDK owners separately.

Out of scope

Impact

None of these symbols are exported from the package __init__.py. Breakage is limited to code importing them from aws_durable_execution_sdk_python.config directly. item_batcher removal also breaks callers that pass the argument to MapConfig, which is why this targets v2.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Fields

No fields configured for Task.

Projects

Status
Ready

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions