Skip to content

Commit cfb4772

Browse files
Abel Milashclaude
andcommitted
Update _BatchContext comment: clarify motivation is clean typing, not just circular import avoidance
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bfd7f07 commit cfb4772

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • src/PowerPlatform/Dataverse/operations

src/PowerPlatform/Dataverse/operations/batch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ class _BatchContext(Protocol):
6868
"""Structural interface required by batch operation namespaces.
6969
7070
The operation namespaces (BatchRecordOperations, BatchTableOperations, etc.)
71-
accept a ``_BatchContext`` rather than a concrete ``BatchRequest`` or
72-
``AsyncBatchRequest``, so that the same namespace classes can be reused by
73-
both the sync and async batch implementations without importing either
74-
concrete class — avoiding a circular dependency.
71+
are pure (no I/O) and shared by both the sync and async batch implementations.
72+
This Protocol allows them to type-annotate their ``batch`` parameter correctly
73+
without importing either concrete class (``BatchRequest`` or
74+
``AsyncBatchRequest``), which would require ``# type: ignore`` or create a
75+
circular import.
7576
7677
Both :class:`~PowerPlatform.Dataverse.operations.batch.BatchRequest` and
7778
:class:`~PowerPlatform.Dataverse.aio.operations.async_batch.AsyncBatchRequest`

0 commit comments

Comments
 (0)