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
Przemek Denkiewicz committed Jul 5, 2024
1 parent 9124e5f commit dfa6840
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 @@ -873,7 +873,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 @@ -972,7 +972,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 @@ -1114,7 +1114,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 @@ -1224,7 +1224,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 @@ -76,7 +76,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 @@ -319,7 +319,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 @@ -336,7 +336,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 @@ -347,15 +347,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 @@ -691,7 +691,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 @@ -729,7 +729,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 dfa6840

Please sign in to comment.