Skip to content

Commit 9c9e392

Browse files
committed
Fix JWT token positional argument order
1 parent 521333d commit 9c9e392

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Changes for crate
55
Unreleased
66
==========
77

8+
- Fixed JWT token positional argument order.
9+
810
2026/03/04 2.1.0
911
================
1012

src/crate/client/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def __init__(
4242
ssl_relax_minimum_version=False,
4343
username=None,
4444
password=None,
45-
jwt_token=None,
4645
schema=None,
4746
pool_size=None,
4847
socket_keepalive=True,
@@ -51,6 +50,7 @@ def __init__(
5150
socket_tcp_keepcnt=None,
5251
converter=None,
5352
time_zone=None,
53+
jwt_token=None,
5454
):
5555
"""
5656
:param servers:
@@ -82,8 +82,6 @@ def __init__(
8282
the username in the database.
8383
:param password:
8484
the password of the user in the database.
85-
:param jwt_token:
86-
the JWT token to authenticate with the server.
8785
:param pool_size:
8886
(optional)
8987
Number of connections to save that can be reused.
@@ -131,6 +129,8 @@ def __init__(
131129
132130
When `time_zone` is given, the timestamp values will be transparently
133131
converted from UTC to use the given time zone.
132+
:param jwt_token:
133+
the JWT token to authenticate with the server.
134134
""" # noqa: E501
135135

136136
self._converter = converter
@@ -151,13 +151,13 @@ def __init__(
151151
ssl_relax_minimum_version=ssl_relax_minimum_version,
152152
username=username,
153153
password=password,
154-
jwt_token=jwt_token,
155154
schema=schema,
156155
pool_size=pool_size,
157156
socket_keepalive=socket_keepalive,
158157
socket_tcp_keepidle=socket_tcp_keepidle,
159158
socket_tcp_keepintvl=socket_tcp_keepintvl,
160159
socket_tcp_keepcnt=socket_tcp_keepcnt,
160+
jwt_token=jwt_token,
161161
)
162162
self.lowest_server_version = self._lowest_server_version()
163163
self._closed = False

src/crate/client/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def request(
170170
headers=None,
171171
username=None,
172172
password=None,
173-
jwt_token=None,
174173
schema=None,
175174
backoff_factor=0,
175+
jwt_token=None,
176176
**kwargs,
177177
):
178178
"""Send a request
@@ -456,13 +456,13 @@ def __init__(
456456
ssl_relax_minimum_version=False,
457457
username=None,
458458
password=None,
459-
jwt_token=None,
460459
schema=None,
461460
pool_size=None,
462461
socket_keepalive=True,
463462
socket_tcp_keepidle=None,
464463
socket_tcp_keepintvl=None,
465464
socket_tcp_keepcnt=None,
465+
jwt_token=None,
466466
):
467467
if not servers:
468468
servers = [self.default_server]
@@ -630,9 +630,9 @@ def _request(self, method, path, server=None, **kwargs):
630630
path,
631631
username=self.username,
632632
password=self.password,
633-
jwt_token=self.jwt_token,
634633
backoff_factor=self.backoff_factor,
635634
schema=self.schema,
635+
jwt_token=self.jwt_token,
636636
**kwargs,
637637
)
638638
redirect_location = response.get_redirect_location()

0 commit comments

Comments
 (0)