Skip to content

Commit 03da5f5

Browse files
committed
constants
1 parent 3cda7e5 commit 03da5f5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: aws_advanced_python_wrapper/driver_dialect.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class DriverDialect(ABC):
3737
"""
3838
Driver dialects help the driver-agnostic AWS Python Driver interface with the driver-specific functionality of the underlying Python Driver.
3939
"""
40+
_QUERY = "SELECT 1"
4041

4142
_executor: ClassVar[Executor] = ThreadPoolExecutor()
4243
_dialect_code: str = DriverDialectCodes.GENERIC
4344
_network_bound_methods: Set[str] = {"*"}
4445
_read_only: bool = False
4546
_autocommit: bool = False
4647
_driver_name: str = "Generic"
47-
_query: str = "SELECT 1"
4848

4949
def __init__(self, props: Properties):
5050
self._props = props
@@ -157,7 +157,7 @@ def transfer_session_state(self, from_conn: Connection, to_conn: Connection):
157157
def ping(self, conn: Connection) -> bool:
158158
try:
159159
with conn.cursor() as cursor:
160-
query = _QUERY
160+
query = DriverDialect._QUERY
161161
self.execute("Cursor.execute", lambda: cursor.execute(query), query, exec_timeout=10)
162162
cursor.fetchone()
163163
return True

Diff for: aws_advanced_python_wrapper/host_monitoring_plugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class Monitor:
349349
_INACTIVE_SLEEP_MS = 100
350350
_MIN_HOST_CHECK_TIMEOUT_MS = 3000
351351
_MONITORING_PROPERTY_PREFIX = "monitoring-"
352-
_QUERY: str = "SELECT 1"
352+
_QUERY = "SELECT 1"
353353

354354
def __init__(
355355
self,
@@ -561,7 +561,7 @@ def _is_host_available(self, conn: Connection, timeout_sec: float) -> bool:
561561
def _execute_conn_check(self, conn: Connection, timeout_sec: float):
562562
driver_dialect = self._plugin_service.driver_dialect
563563
with conn.cursor() as cursor:
564-
query = _query
564+
query = Monitor._QUERY
565565
driver_dialect.execute("Cursor.execute", lambda: cursor.execute(query), query, exec_timeout=timeout_sec)
566566
cursor.fetchone()
567567

0 commit comments

Comments
 (0)