[2022-01-14T19:46:15.342Z] Exception: TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'dict'
[2022-01-14T19:46:15.342Z] Stack: File "/usr/local/Cellar/azure-functions-core-tools@4/4.0.3971/workers/python/3.9/OSX/X64/azure_functions_worker/dis
patcher.py", line 305, in _handle__function_load_request
[2022-01-14T19:46:15.342Z] func = loader.load_function(
[2022-01-14T19:46:15.342Z] File "/usr/local/Cellar/azure-functions-core-tools@4/4.0.3971/workers/python/3.9/OSX/X64/azure_functions_worker/utils/wrap
pers.py", line 40, in call
[2022-01-14T19:46:15.342Z] return func(*args, **kwargs)
[2022-01-14T19:46:15.342Z] File "/usr/local/Cellar/azure-functions-core-tools@4/4.0.3971/workers/python/3.9/OSX/X64/azure_functions_worker/loader.py"
, line 85, in load_function
[2022-01-14T19:46:15.342Z] mod = importlib.import_module(fullmodname)
[2022-01-14T19:46:15.342Z] File "/Users/trutkin/.asdf/installs/python/3.9.7/lib/python3.9/importlib/__init__.py", line 127, in import_module
[2022-01-14T19:46:15.342Z] return _bootstrap._gcd_import(name[level:], package, level)
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap_external>", line 850, in exec_module
[2022-01-14T19:46:15.342Z] File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
[2022-01-14T19:46:15.342Z] File "/Users/trutkin/src/udm_v2/src/function_apps/projection_handler/projection_handler/__init__.py", line 35, in <module>
[2022-01-14T19:46:15.342Z] cosmos_client = CosmosClient.from_connection_string(DOCUMENTDB_CONNSTR)
[2022-01-14T19:46:15.342Z] File "/Users/trutkin/src/udm_v2/src/function_apps/projection_handler/.venv/lib/python3.9/site-packages/azure/cosmos/aio/co
smos_client.py", line 180, in from_connection_string
[2022-01-14T19:46:15.342Z] consistency_level=kwargs.get("consistency_level", "Session") ** kwargs,
[2022-01-14T19:46:15.342Z] .
Running a linter on python code is very helpful for catching these sort of issues.
Describe the bug
A comma is missing at the end of line 162:
azure-sdk-for-python/sdk/cosmos/azure-cosmos/azure/cosmos/aio/cosmos_client.py
Lines 159 to 164 in 9eca55e
This results in python trying to use the
**operator on a string and a dict and it throws an exception.To Reproduce
cosmos.aure.aio.CosmosClient.from_connection_string()Expected behavior
The function should not throw an exception
Additional context
Full stack trace:
Running a linter on python code is very helpful for catching these sort of issues.