Skip to content

Commit

Permalink
Remove legacy (object) from class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
hovaesco authored and hashhar committed Sep 2, 2024
1 parent 611d9d2 commit a875667
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def test_extra_credential_value_encoding(mock_get_and_post):
def test_extra_credential_value_object(mock_get_and_post):
_, post = mock_get_and_post

class TestCredential(object):
class TestCredential:
value = "initial"

def __str__(self):
Expand Down Expand Up @@ -980,7 +980,7 @@ def test_authentication_gssapi_init_arguments(
assert session.auth.creds == expected_credentials


class RetryRecorder(object):
class RetryRecorder:
def __init__(self, error=None, result=None):
self.__name__ = "RetryRecorder"
self._retry_count = 0
Expand Down Expand Up @@ -1122,7 +1122,7 @@ def test_error_no_retry(status_code, monkeypatch):
assert post_retry.retry_count == 1


class FakeGatewayResponse(object):
class FakeGatewayResponse:
def __init__(self, http_response, redirect_count=1):
self.__name__ = "FakeGatewayResponse"
self.http_response = http_response
Expand Down Expand Up @@ -1232,7 +1232,7 @@ def test_retry_with():
max_attempts=max_attempts,
)

class FailerUntil(object):
class FailerUntil:
def __init__(self, until=1):
self.attempt = 0
self._until = until
Expand Down
14 changes: 7 additions & 7 deletions trino/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
ROLE_PATTERN = re.compile(r"^ROLE\{(.*)\}$")


class ClientSession(object):
class ClientSession:
"""
Manage the current Client Session properties of a specific connection. This class is thread-safe.
Expand Down Expand Up @@ -321,7 +321,7 @@ def __repr__(self):
)


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


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


class _RetryAfterSleep(object):
class _RetryAfterSleep:
def __init__(self, retry_after_header):
self._retry_after_header = retry_after_header

def retry(self):
sleep(self._retry_after_header)


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


class TrinoResult(object):
class TrinoResult:
"""
Represent the result of a Trino query as an iterator on rows.
Expand Down Expand Up @@ -731,7 +731,7 @@ def __iter__(self):
self._rows = next_rows


class TrinoQuery(object):
class TrinoQuery:
"""Represent the execution of a SQL statement by Trino."""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions trino/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def connect(*args, **kwargs):
return Connection(*args, **kwargs)


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


class Cursor(object):
class Cursor:
"""Database cursor.
Cursors are not isolated, i.e., any changes done to the database by a
Expand Down
2 changes: 1 addition & 1 deletion trino/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def check(cls, level: int) -> int:
return level


class Transaction(object):
class Transaction:
def __init__(self, request: trino.client.TrinoRequest) -> None:
self._request = request
self._id = NO_TRANSACTION
Expand Down

0 comments on commit a875667

Please sign in to comment.