Skip to content

Commit bcd08f1

Browse files
michael.yakmichaelyaakoby
authored andcommitted
Mypy is having issues with sqlalchemy
Mypy is complaining that: ```"PoolProxiedConnection" is missing following "DBAPIConnection" protocol member: autocommit``` Couldn't find a reasonable fix so am silenting mypy.
1 parent 4f078e1 commit bcd08f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyctuator/health/db_health_provider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def get_name(self) -> str:
3333

3434
def get_health(self) -> DbHealthStatus:
3535
try:
36-
conn = self.engine.raw_connection()
37-
if self.engine.dialect.do_ping(conn):
38-
return DbHealthStatus(status=Status.UP, details=DbHealthDetails(self.engine.name))
36+
with self.engine.connect() as conn:
37+
if self.engine.dialect.do_ping(conn.connection): # type: ignore[arg-type]
38+
return DbHealthStatus(status=Status.UP, details=DbHealthDetails(self.engine.name))
3939

4040
return DbHealthStatus(
4141
status=Status.UNKNOWN,

0 commit comments

Comments
 (0)