Skip to content

Commit a875667

Browse files
hovaescohashhar
authored andcommitted
Remove legacy (object) from class definition
1 parent 611d9d2 commit a875667

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tests/unit/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def test_extra_credential_value_encoding(mock_get_and_post):
881881
def test_extra_credential_value_object(mock_get_and_post):
882882
_, post = mock_get_and_post
883883

884-
class TestCredential(object):
884+
class TestCredential:
885885
value = "initial"
886886

887887
def __str__(self):
@@ -980,7 +980,7 @@ def test_authentication_gssapi_init_arguments(
980980
assert session.auth.creds == expected_credentials
981981

982982

983-
class RetryRecorder(object):
983+
class RetryRecorder:
984984
def __init__(self, error=None, result=None):
985985
self.__name__ = "RetryRecorder"
986986
self._retry_count = 0
@@ -1122,7 +1122,7 @@ def test_error_no_retry(status_code, monkeypatch):
11221122
assert post_retry.retry_count == 1
11231123

11241124

1125-
class FakeGatewayResponse(object):
1125+
class FakeGatewayResponse:
11261126
def __init__(self, http_response, redirect_count=1):
11271127
self.__name__ = "FakeGatewayResponse"
11281128
self.http_response = http_response
@@ -1232,7 +1232,7 @@ def test_retry_with():
12321232
max_attempts=max_attempts,
12331233
)
12341234

1235-
class FailerUntil(object):
1235+
class FailerUntil:
12361236
def __init__(self, until=1):
12371237
self.attempt = 0
12381238
self._until = until

trino/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
ROLE_PATTERN = re.compile(r"^ROLE\{(.*)\}$")
7979

8080

81-
class ClientSession(object):
81+
class ClientSession:
8282
"""
8383
Manage the current Client Session properties of a specific connection. This class is thread-safe.
8484
@@ -321,7 +321,7 @@ def __repr__(self):
321321
)
322322

323323

324-
class _DelayExponential(object):
324+
class _DelayExponential:
325325
def __init__(
326326
self, base=0.1, exponent=2, jitter=True, max_delay=1800 # 100ms # 30 min
327327
):
@@ -338,7 +338,7 @@ def __call__(self, attempt):
338338
return delay
339339

340340

341-
class _RetryWithExponentialBackoff(object):
341+
class _RetryWithExponentialBackoff:
342342
def __init__(
343343
self, base=0.1, exponent=2, jitter=True, max_delay=1800 # 100ms # 30 min
344344
):
@@ -349,15 +349,15 @@ def retry(self, func, args, kwargs, err, attempt):
349349
sleep(delay)
350350

351351

352-
class _RetryAfterSleep(object):
352+
class _RetryAfterSleep:
353353
def __init__(self, retry_after_header):
354354
self._retry_after_header = retry_after_header
355355

356356
def retry(self):
357357
sleep(self._retry_after_header)
358358

359359

360-
class TrinoRequest(object):
360+
class TrinoRequest:
361361
"""
362362
Manage the HTTP requests of a Trino query.
363363
@@ -693,7 +693,7 @@ def _verify_extra_credential(self, header):
693693
raise ValueError(f"only ASCII characters are allowed in extra credential '{key}'")
694694

695695

696-
class TrinoResult(object):
696+
class TrinoResult:
697697
"""
698698
Represent the result of a Trino query as an iterator on rows.
699699
@@ -731,7 +731,7 @@ def __iter__(self):
731731
self._rows = next_rows
732732

733733

734-
class TrinoQuery(object):
734+
class TrinoQuery:
735735
"""Represent the execution of a SQL statement by Trino."""
736736

737737
def __init__(

trino/dbapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def connect(*args, **kwargs):
126126
return Connection(*args, **kwargs)
127127

128128

129-
class Connection(object):
129+
class Connection:
130130
"""Trino supports transactions and the ability to either commit or rollback
131131
a sequence of SQL statements. A single query i.e. the execution of a SQL
132132
statement, can also be cancelled. Transactions are not supported by this
@@ -329,7 +329,7 @@ def from_column(cls, column: Dict[str, Any]):
329329
)
330330

331331

332-
class Cursor(object):
332+
class Cursor:
333333
"""Database cursor.
334334
335335
Cursors are not isolated, i.e., any changes done to the database by a

trino/transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def check(cls, level: int) -> int:
4949
return level
5050

5151

52-
class Transaction(object):
52+
class Transaction:
5353
def __init__(self, request: trino.client.TrinoRequest) -> None:
5454
self._request = request
5555
self._id = NO_TRANSACTION

0 commit comments

Comments
 (0)