Skip to content

Commit a20ca7f

Browse files
committed
use sqlalchemy.text for healthcheck
ref pandas-dev/pandas#51061
1 parent df8b325 commit a20ca7f

File tree

1 file changed

+2
-1
lines changed
  • repo-template-files/quickstarts/flask-quickstart/src/web

1 file changed

+2
-1
lines changed

repo-template-files/quickstarts/flask-quickstart/src/web/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from flask import Flask, render_template
22
from db import get_db, close_db
33
import sqlalchemy
4+
from sqlalchemy import text
45
from logger import log
56

67
app = Flask(__name__)
@@ -18,7 +19,7 @@ def health():
1819
db = get_db()
1920
health = "BAD"
2021
try:
21-
result = db.execute("SELECT NOW()")
22+
result = db.execute(text("SELECT NOW()"))
2223
result = result.one()
2324
health = "OK"
2425
log.info(f"/health reported OK including database connection: {result}")

0 commit comments

Comments
 (0)