Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,18 +7,20 @@ import cohere
|
|
| 7 |
# Load environment variables
|
| 8 |
load_dotenv(verbose=True)
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Function to fetch top high performers
|
| 11 |
#def get_top_high_performers(html: str):
|
| 12 |
def get_top_high_performers(html: str, limit: str):
|
| 13 |
-
|
| 14 |
-
conn = mysql.connector.connect(
|
| 15 |
-
host=os.environ.get("HOST"),
|
| 16 |
-
user=os.environ.get("USER_NAME"),
|
| 17 |
-
password=os.environ.get("PASSWORD"),
|
| 18 |
-
port=os.environ.get("PORT"),
|
| 19 |
-
database=os.environ.get("DB"),
|
| 20 |
-
ssl_disabled=True
|
| 21 |
-
)
|
| 22 |
cursor = conn.cursor(dictionary=True)
|
| 23 |
try:
|
| 24 |
with cursor:
|
|
|
|
| 7 |
# Load environment variables
|
| 8 |
load_dotenv(verbose=True)
|
| 9 |
|
| 10 |
+
# Establish database connection
|
| 11 |
+
conn = mysql.connector.connect(
|
| 12 |
+
host=os.environ.get("HOST"),
|
| 13 |
+
user=os.environ.get("USER_NAME"),
|
| 14 |
+
password=os.environ.get("PASSWORD"),
|
| 15 |
+
port=os.environ.get("PORT"),
|
| 16 |
+
database=os.environ.get("DB"),
|
| 17 |
+
ssl_disabled=True
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
# Function to fetch top high performers
|
| 21 |
#def get_top_high_performers(html: str):
|
| 22 |
def get_top_high_performers(html: str, limit: str):
|
| 23 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
cursor = conn.cursor(dictionary=True)
|
| 25 |
try:
|
| 26 |
with cursor:
|