Skip to content

Commit 4bf4713

Browse files
Abel Milashclaude
andcommitted
Clarify max_workers cap wording in docstrings and comments
Replace 'silently capped' with 'capped to _MAX_WORKERS' throughout _odata.py to be consistent with the UserWarning now emitted on cap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2601bd4 commit 4bf4713

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/PowerPlatform/Dataverse/data/_odata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
_DEFAULT_EXPECTED_STATUSES: tuple[int, ...] = (200, 201, 202, 204)
5959
_MULTIPLE_BATCH_SIZE = 1000
6060
# Concurrent chunk dispatch settings
61-
_MAX_WORKERS = 3 # maximum concurrent worker threads; values above this are capped
61+
_MAX_WORKERS = 3 # maximum concurrent worker threads; values above this are capped to _MAX_WORKERS
6262
_CHUNK_RETRY_LIMIT = 3 # max retries per chunk on transient errors
6363
_CHUNK_RETRY_DEFAULT_WAIT = 60 # seconds to wait when Retry-After header is absent
6464
_CHUNK_RETRY_JITTER_MAX = 5 # seconds of random jitter added to Retry-After to desynchronise workers
@@ -68,7 +68,7 @@ def _dispatch_chunks(fn: Callable, chunks: List, max_workers: int) -> List:
6868
"""Dispatch ``fn(chunk)`` for each chunk, sequentially or concurrently.
6969
7070
If ``max_workers`` exceeds ``_MAX_WORKERS`` (3) a :class:`UserWarning` is
71-
issued and the value is capped.
71+
issued and the value is capped to ``_MAX_WORKERS``.
7272
7373
When ``max_workers == 1`` or there is only one chunk, runs sequentially
7474
with no thread overhead. When ``max_workers > 1`` and there are multiple
@@ -578,7 +578,7 @@ def _upsert_multiple(
578578
Must be the same length as ``alternate_keys``.
579579
:type records: ``list[dict[str, Any]]``
580580
:param max_workers: Maximum number of concurrent worker threads for chunk dispatch.
581-
Values above ``_MAX_WORKERS`` are silently capped.
581+
Values above ``_MAX_WORKERS`` are capped to ``_MAX_WORKERS``.
582582
:type max_workers: ``int``
583583
584584
:return: ``None``
@@ -761,7 +761,7 @@ def _update_multiple(
761761
:param records: List of patch dictionaries. Each must include the true primary key attribute (e.g. ``accountid``) and one or more fields to update.
762762
:type records: ``list[dict[str, Any]]``
763763
:param max_workers: Maximum number of concurrent worker threads for chunk dispatch.
764-
Values above ``_MAX_WORKERS`` are silently capped.
764+
Values above ``_MAX_WORKERS`` are capped to ``_MAX_WORKERS``.
765765
:type max_workers: ``int``
766766
:return: ``None``
767767
:rtype: ``None``

0 commit comments

Comments
 (0)