fix: ensure requestTimeout and maxRetries are integers#394
fix: ensure requestTimeout and maxRetries are integers#394tgarciaalv wants to merge 3 commits intookta:masterfrom
Conversation
|
@tgarciaalv I apologize for the delayed response and thank you for your submission. To ensure integrity, please provide a unit test that fails prior to your proposed change and passes with your change in place. We appreciate your engagement and thanks for using Okta! |
|
Hi @tgarciaalv, |
This is failing when environment variables are used for configuration. Env vars are strings but are never converted to int before using them in arithmetic operations.
# Raise Value Error if numerical inputs are invalid (< 0)
self._request_timeout = config["client"].get('requestTimeout', 0)
> if self._request_timeout < 0:
E TypeError: '<' not supported between instances of 'str' and 'int'
/opt/homebrew/lib/python3.11/site-packages/okta/request_executor.py:35: TypeError
|
Hi @bryanapellanes-okta @BinoyOza-okta, Thanks for the feedback. I've rebased onto Changes1.
2. Unit tests (tests/unit/test_request_executor.py)
3. Python 3.13 CI fix (requirements.txt, setup.py, okta/config/config_setter.py)
How to verifypytest tests/unit/test_request_executor.py::TestRequestExecutorStringConfig -vLet me know if anything else is needed. |
flatdict==4.0.1 (last release 2020) uses pkg_resources in its setup.py, which was removed from Python 3.13 stdlib. flatdict2 is a maintained fork with identical API and pre-built wheels.
This is failing when environment variables are used for configuration. Env vars are strings but are never converted to int before using them in arithmetic operations.
My configuration:
My error:
The os.environ dictionary in Python expects its values to be strings.