Skip to content

Commit 28debbf

Browse files
committed
use management.version when version is not passed
1 parent b473889 commit 28debbf

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

singlestoredb/management/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def manage_cluster(
440440
access_token : str, optional
441441
The API key or other access token for the cluster management API
442442
version : str, optional
443-
Version of the API to use
443+
Version of the API to use (default: 'v1')
444444
base_url : str, optional
445445
Base URL of the cluster management API
446446
organization_id: str, optional

singlestoredb/management/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def manage_files(
534534
access_token : str, optional
535535
The API key or other access token for the files management API
536536
version : str, optional
537-
Version of the API to use
537+
Version of the API to use (default: 'v1')
538538
base_url : str, optional
539539
Base URL of the files management API
540540
organization_id : str, optional

singlestoredb/management/manager.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Manager(object):
5252
obj_type = ''
5353

5454
def __init__(
55-
self, access_token: Optional[str] = None, version: Optional[str] = 'v1',
55+
self, access_token: Optional[str] = None, version: Optional[str] = None,
5656
base_url: Optional[str] = None, *, organization_id: Optional[str] = None,
5757
):
5858
from .. import __version__ as client_version
@@ -71,13 +71,12 @@ def __init__(
7171
'User-Agent': f'SingleStoreDB-Python/{client_version}',
7272
})
7373

74-
self._base_url = ''.join([
74+
self._base_url = (
7575
base_url
7676
or config.get_option('management.base_url')
77-
or type(self).default_base_url,
78-
'/',
79-
])
80-
self._version = version
77+
or type(self).default_base_url
78+
) + '/'
79+
self._version = version or config.get_option('management.version') or 'v1'
8180
self._access_token = new_access_token
8281
self._params: Dict[str, str] = {}
8382
if organization_id:

singlestoredb/management/region.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def manage_regions(
143143
access_token : str, optional
144144
The API key or other access token for the workspace management API
145145
version : str, optional
146-
Version of the API to use
146+
Version of the API to use (default: 'v1')
147147
base_url : str, optional
148148
Base URL of the workspace management API
149149

singlestoredb/management/workspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ def manage_workspaces(
19781978
access_token : str, optional
19791979
The API key or other access token for the workspace management API
19801980
version : str, optional
1981-
Version of the API to use
1981+
Version of the API to use (default is 'v1')
19821982
base_url : str, optional
19831983
Base URL of the workspace management API
19841984
organization_id : str, optional

0 commit comments

Comments
 (0)