You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Issue #43211: Make max_concurrency optional (sync only) and fix create_database overloads (#43269)
* Initial plan
* Implement max_concurrency optional and fix database method overloads
- Make max_concurrency Optional[int] in read_items (container.py)
- Update default to None to use Python's ThreadPoolExecutor default
- Update _read_items_helper.py to accept Optional[int] for max_concurrency
- Update _cosmos_client_connection.py to default to None
- Fix create_database overloads (sync): remove populate_query_metrics, make offer_throughput keyword-only, add response_hook
- Fix create_database_if_not_exists overloads (sync): same changes
- Fix create_database overloads (async): add response_hook parameter
- Fix create_database_if_not_exists overloads (async): add response_hook parameter
- Update implementations to handle response_hook and remove positional offer_throughput/populate_query_metrics
Co-authored-by: bambriz <[email protected]>
* Add unit tests for max_concurrency optional behavior
Co-authored-by: bambriz <[email protected]>
* updated docstrings for create_Database
Updated docstrings for create_Database in sync and async versions.
* Address review comments: update docstrings, add tests, fix async version
- Add max_concurrency to docstring in _cosmos_client_connection.py
- Update docstring to use generic language about ThreadPoolExecutor default
- Add tests for max_concurrency ignored with executor and Python default behavior
- Update async version of read_items to also use Optional[int] for max_concurrency
- Update async _cosmos_client_connection_async.py to use None as default
Co-authored-by: allenkim0129 <[email protected]>
* Revert async changes - only sync path should be modified
- Revert aio/_container.py to keep max_concurrency: int = 10
- Revert aio/_cosmos_client_connection_async.py to keep default of 10
- Async uses asyncio.Semaphore instead of ThreadPoolExecutor
- Only sync path uses ThreadPoolExecutor and benefits from Optional behavior
Co-authored-by: simorenoh <[email protected]>
* update changes
* max concurrency update
updated default of async max currency to be None in public facing api, internally we set to 5.
* pylint and test fixes
* Update _container.py
fix docstring indentation
* update quick fixes
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: bambriz <[email protected]>
Co-authored-by: bambriz <[email protected]>
Co-authored-by: allenkim0129 <[email protected]>
Co-authored-by: simorenoh <[email protected]>
Co-authored-by: bambriz <[email protected]>
0 commit comments