Skip to content

Commit bfd7f07

Browse files
Abel Milashclaude
andcommitted
Add comment explaining why _BatchContext Protocol exists
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0561dee commit bfd7f07

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • src/PowerPlatform/Dataverse/operations

src/PowerPlatform/Dataverse/operations/batch.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@
6767
class _BatchContext(Protocol):
6868
"""Structural interface required by batch operation namespaces.
6969
70+
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.
75+
7076
Both :class:`~PowerPlatform.Dataverse.operations.batch.BatchRequest` and
7177
:class:`~PowerPlatform.Dataverse.aio.operations.async_batch.AsyncBatchRequest`
72-
satisfy this protocol — no explicit inheritance needed on either class.
78+
satisfy this protocol structurally — no explicit inheritance needed.
7379
"""
7480

7581
_items: List[Any]

0 commit comments

Comments
 (0)