Skip to content

fix: Import concrete BatchResult#294

Merged
yaythomas merged 1 commit intomainfrom
batchresult-concrete
Feb 4, 2026
Merged

fix: Import concrete BatchResult#294
yaythomas merged 1 commit intomainfrom
batchresult-concrete

Conversation

@yaythomas
Copy link
Member

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.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.
@yaythomas yaythomas force-pushed the batchresult-concrete branch from c67e065 to d9ff4e5 Compare February 4, 2026 16:55
@yaythomas yaythomas merged commit e4bfd00 into main Feb 4, 2026
14 of 15 checks passed
@yaythomas yaythomas deleted the batchresult-concrete branch February 4, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants