From 4924be239322ec9b468dd409aa13eec8fdcce2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Gr=C3=B8nbech?= Date: Thu, 4 Jun 2026 22:37:28 +0200 Subject: [PATCH] feat: allow float timeouts in the clientconfig --- cognite/client/config.py | 4 ++-- tests/tests_integration/conftest.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cognite/client/config.py b/cognite/client/config.py index 19b6e96516..51c4a50366 100644 --- a/cognite/client/config.py +++ b/cognite/client/config.py @@ -190,7 +190,7 @@ class ClientConfig: cluster (str | None): The cluster where the CDF project is located. When passed, it is assumed that the base URL can be constructed as: ``https://.cognitedata.com``. Either base_url or cluster must be provided. headers (dict[str, str] | None): Additional headers to add to all requests. - timeout (int | None): Timeout on requests sent to the api. Defaults to 60 seconds. + timeout (float | None): Timeout on requests sent to the api. Defaults to 60 seconds. file_transfer_timeout (int | None): Timeout on file upload/download requests. Defaults to 600 seconds. debug (bool): Enables debug logging to stderr. This includes full request/response details and logs regarding retry attempts (e.g., on 429 throttling or 5xx errors). @@ -205,7 +205,7 @@ def __init__( base_url: str | None = None, cluster: str | None = None, headers: dict[str, str] | None = None, - timeout: int | None = None, + timeout: float | None = None, file_transfer_timeout: int | None = None, debug: bool = False, ) -> None: diff --git a/tests/tests_integration/conftest.py b/tests/tests_integration/conftest.py index 0786534dc0..5bb6c25fbf 100644 --- a/tests/tests_integration/conftest.py +++ b/tests/tests_integration/conftest.py @@ -89,6 +89,7 @@ def make_cognite_client() -> CogniteClient: project=os.environ["COGNITE_PROJECT"], base_url=os.environ["COGNITE_BASE_URL"], credentials=credentials, + timeout=59.9, # Test that a non-int timeout works ) )