Skip to content

Commit 52e1077

Browse files
fix: resolve cyclic dependency (#346)
1 parent 5b5688a commit 52e1077

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

src/firebolt/async_db/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from firebolt.client.auth import Auth
1212
from firebolt.client.client import AsyncClient, AsyncClientV1, AsyncClientV2
1313
from firebolt.common.base_connection import BaseConnection
14-
from firebolt.common.settings import DEFAULT_TIMEOUT_SECONDS
14+
from firebolt.common.constants import DEFAULT_TIMEOUT_SECONDS
1515
from firebolt.utils.exception import (
1616
ConfigurationError,
1717
ConnectionClosedError,

src/firebolt/async_db/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from firebolt.client.auth import Auth
66
from firebolt.client.client import AsyncClientV2
7-
from firebolt.common.settings import DEFAULT_TIMEOUT_SECONDS
7+
from firebolt.common.constants import DEFAULT_TIMEOUT_SECONDS
88
from firebolt.utils.exception import (
99
AccountNotFoundOrNoAccessError,
1010
InterfaceError,

src/firebolt/client/http_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from httpx import AsyncHTTPTransport, HTTPTransport
1212

13-
from firebolt.common.settings import KEEPALIVE_FLAG, KEEPIDLE_RATE
13+
from firebolt.common.constants import KEEPALIVE_FLAG, KEEPIDLE_RATE
1414

1515

1616
def override_stream(stream): # type: ignore [no-untyped-def]

src/firebolt/common/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
KEEPALIVE_FLAG: int = 1
2+
KEEPIDLE_RATE: int = 60 # seconds
3+
DEFAULT_TIMEOUT_SECONDS: int = 60

src/firebolt/common/settings.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
logger = logging.getLogger(__name__)
99

10-
KEEPALIVE_FLAG: int = 1
11-
12-
KEEPIDLE_RATE: int = 60 # seconds
13-
DEFAULT_TIMEOUT_SECONDS: int = 60
14-
1510
CLIENT_ID_ENV = "FIREBOLT_CLIENT_ID"
1611
CLIENT_SECRET_ENV = "FIREBOLT_CLIENT_SECRET"
1712
ACCOUNT_ENV = "FIREBOLT_ACCOUNT"

src/firebolt/db/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from firebolt.client import DEFAULT_API_URL, Client, ClientV1, ClientV2
1111
from firebolt.client.auth import Auth
1212
from firebolt.common.base_connection import BaseConnection
13-
from firebolt.common.settings import DEFAULT_TIMEOUT_SECONDS
13+
from firebolt.common.constants import DEFAULT_TIMEOUT_SECONDS
1414
from firebolt.db.cursor import Cursor, CursorV1, CursorV2
1515
from firebolt.db.util import _get_system_engine_url
1616
from firebolt.utils.exception import (

src/firebolt/db/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from firebolt.client import ClientV2
66
from firebolt.client.auth import Auth
7-
from firebolt.common.settings import DEFAULT_TIMEOUT_SECONDS
7+
from firebolt.common.constants import DEFAULT_TIMEOUT_SECONDS
88
from firebolt.utils.exception import (
99
AccountNotFoundOrNoAccessError,
1010
InterfaceError,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_has_firebolt_error():
2+
from firebolt.common.exception import FireboltError # NOQA

0 commit comments

Comments
 (0)