[add]: Database config
This commit is contained in:
@@ -211,3 +211,135 @@
|
||||
2025-09-09 11:05:42,204 - ERROR - Error loading data: 500: Failed to load data
|
||||
2025-09-09 11:05:42,206 - INFO - Load data endpoint failed after 60.94 seconds
|
||||
2025-09-09 11:06:18,783 - INFO - [2025-09-09 11:06:18] Detecting salary...
|
||||
2025-09-09 11:13:13,121 - INFO - Initializing pipeline...
|
||||
2025-09-09 11:13:13,125 - INFO - [2025-09-09 11:13:13] Detecting salary...
|
||||
2025-09-09 11:13:13,126 - INFO - Started autonomous salary detection loop.
|
||||
2025-09-09 11:13:13,131 - INFO - Server running on hostname: 5d4fdd4232a7
|
||||
2025-09-09 11:13:13,138 - INFO - Server IP address: 172.25.0.2
|
||||
2025-09-09 11:13:13,139 - INFO - Server is accessible at:
|
||||
2025-09-09 11:13:13,150 - INFO - - http://localhost:8000
|
||||
2025-09-09 11:13:13,151 - INFO - - http://127.0.0.1:8000
|
||||
2025-09-09 11:13:13,155 - INFO - - http://172.25.0.2:8000
|
||||
2025-09-09 11:13:13,155 - INFO - Pipeline initialized successfully
|
||||
2025-09-09 11:13:13,762 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:13:13,763 - INFO - [2025-09-09 11:13:13] Salary detection complete
|
||||
2025-09-09 11:15:13,767 - INFO - [2025-09-09 11:15:13] Detecting salary...
|
||||
2025-09-09 11:15:14,439 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:15:14,440 - INFO - [2025-09-09 11:15:14] Salary detection complete
|
||||
2025-09-09 11:15:18,049 - INFO - Shutting down Salary Analytics API...
|
||||
2025-09-09 11:15:31,532 - INFO - Initializing pipeline...
|
||||
2025-09-09 11:15:31,535 - INFO - [2025-09-09 11:15:31] Detecting salary...
|
||||
2025-09-09 11:15:31,535 - INFO - Started autonomous salary detection loop.
|
||||
2025-09-09 11:15:31,544 - INFO - Server running on hostname: 5d4fdd4232a7
|
||||
2025-09-09 11:15:31,545 - INFO - Server IP address: 172.25.0.2
|
||||
2025-09-09 11:15:31,546 - INFO - Server is accessible at:
|
||||
2025-09-09 11:15:31,548 - INFO - - http://localhost:8000
|
||||
2025-09-09 11:15:31,548 - INFO - - http://127.0.0.1:8000
|
||||
2025-09-09 11:15:31,550 - INFO - - http://172.25.0.2:8000
|
||||
2025-09-09 11:15:31,551 - INFO - Pipeline initialized successfully
|
||||
2025-09-09 11:15:44,793 - INFO - Initializing pipeline...
|
||||
2025-09-09 11:15:44,795 - INFO - [2025-09-09 11:15:44] Detecting salary...
|
||||
2025-09-09 11:15:44,795 - INFO - Started autonomous salary detection loop.
|
||||
2025-09-09 11:15:44,804 - INFO - Server running on hostname: 5d4fdd4232a7
|
||||
2025-09-09 11:15:44,805 - INFO - Server IP address: 172.25.0.2
|
||||
2025-09-09 11:15:44,805 - INFO - Server is accessible at:
|
||||
2025-09-09 11:15:44,806 - INFO - - http://localhost:8000
|
||||
2025-09-09 11:15:44,807 - INFO - - http://127.0.0.1:8000
|
||||
2025-09-09 11:15:44,809 - INFO - - http://172.25.0.2:8000
|
||||
2025-09-09 11:15:44,810 - INFO - Pipeline initialized successfully
|
||||
2025-09-09 11:16:01,481 - INFO - Initializing pipeline...
|
||||
2025-09-09 11:16:01,485 - INFO - [2025-09-09 11:16:01] Detecting salary...
|
||||
2025-09-09 11:16:01,486 - INFO - Started autonomous salary detection loop.
|
||||
2025-09-09 11:16:01,497 - INFO - Server running on hostname: 5d4fdd4232a7
|
||||
2025-09-09 11:16:01,499 - INFO - Server IP address: 172.25.0.2
|
||||
2025-09-09 11:16:01,500 - INFO - Server is accessible at:
|
||||
2025-09-09 11:16:01,501 - INFO - - http://localhost:8000
|
||||
2025-09-09 11:16:01,504 - INFO - - http://127.0.0.1:8000
|
||||
2025-09-09 11:16:01,505 - INFO - - http://172.25.0.2:8000
|
||||
2025-09-09 11:16:01,520 - INFO - Pipeline initialized successfully
|
||||
2025-09-09 11:16:02,407 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:16:02,416 - INFO - [2025-09-09 11:16:02] Salary detection complete
|
||||
2025-09-09 11:18:02,428 - INFO - [2025-09-09 11:18:02] Detecting salary...
|
||||
2025-09-09 11:18:03,770 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:18:03,770 - INFO - [2025-09-09 11:18:03] Salary detection complete
|
||||
2025-09-09 11:18:43,964 - INFO - Shutting down Salary Analytics API...
|
||||
2025-09-09 11:19:08,819 - INFO - generated new fontManager
|
||||
2025-09-09 11:19:13,397 - INFO - Initializing pipeline...
|
||||
2025-09-09 11:19:13,399 - INFO - [2025-09-09 11:19:13] Detecting salary...
|
||||
2025-09-09 11:19:13,399 - INFO - Started autonomous salary detection loop.
|
||||
2025-09-09 11:19:13,409 - INFO - Server running on hostname: 7c67294712af
|
||||
2025-09-09 11:19:13,409 - INFO - Server IP address: 172.25.0.2
|
||||
2025-09-09 11:19:13,417 - INFO - Server is accessible at:
|
||||
2025-09-09 11:19:13,421 - INFO - - http://localhost:8000
|
||||
2025-09-09 11:19:13,422 - INFO - - http://127.0.0.1:8000
|
||||
2025-09-09 11:19:13,423 - INFO - - http://172.25.0.2:8000
|
||||
2025-09-09 11:19:13,425 - INFO - Pipeline initialized successfully
|
||||
2025-09-09 11:19:14,059 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:19:14,060 - INFO - [2025-09-09 11:19:14] Salary detection complete
|
||||
2025-09-09 11:19:58,717 - INFO - Initializing SalaryAnalyticsPipeline
|
||||
2025-09-09 11:19:58,718 - INFO - Starting data loading process
|
||||
2025-09-09 11:19:58,718 - INFO - No database connection. Attempting to connect...
|
||||
2025-09-09 11:19:58,719 - INFO - Attempting to connect to database...
|
||||
2025-09-09 11:19:58,793 - ERROR - Error connecting to database: No module named 'oracledb'
|
||||
2025-09-09 11:19:58,794 - ERROR - Failed to establish database connection
|
||||
2025-09-09 11:19:58,794 - ERROR - Failed to load data
|
||||
2025-09-09 11:19:58,795 - ERROR - Failed to load data
|
||||
2025-09-09 11:19:58,795 - INFO - Load data endpoint failed after 0.08 seconds
|
||||
2025-09-09 11:19:58,796 - ERROR - Error loading data: 500: Failed to load data
|
||||
2025-09-09 11:19:58,797 - INFO - Load data endpoint failed after 0.08 seconds
|
||||
2025-09-09 11:20:01,415 - INFO - Starting data loading process
|
||||
2025-09-09 11:20:01,437 - INFO - No database connection. Attempting to connect...
|
||||
2025-09-09 11:20:01,443 - INFO - Attempting to connect to database...
|
||||
2025-09-09 11:20:01,445 - ERROR - Error connecting to database: No module named 'oracledb'
|
||||
2025-09-09 11:20:01,445 - ERROR - Failed to establish database connection
|
||||
2025-09-09 11:20:01,447 - ERROR - Failed to load data
|
||||
2025-09-09 11:20:01,448 - ERROR - Failed to load data
|
||||
2025-09-09 11:20:01,449 - INFO - Load data endpoint failed after 0.03 seconds
|
||||
2025-09-09 11:20:01,449 - ERROR - Error loading data: 500: Failed to load data
|
||||
2025-09-09 11:20:01,450 - INFO - Load data endpoint failed after 0.03 seconds
|
||||
2025-09-09 11:21:14,063 - INFO - [2025-09-09 11:21:14] Detecting salary...
|
||||
2025-09-09 11:21:14,834 - INFO - POST http://www.simbrellang.net:5000/autocall/analytic-salary-detect status: 200, response: {
|
||||
"data": [],
|
||||
"error": {},
|
||||
"message": "AutoCall Add Salary Successful",
|
||||
"status": true,
|
||||
"statusCode": 200
|
||||
}
|
||||
|
||||
2025-09-09 11:21:14,835 - INFO - [2025-09-09 11:21:14] Salary detection complete
|
||||
2025-09-09 11:21:19,646 - INFO - Shutting down Salary Analytics API...
|
||||
|
||||
@@ -7,7 +7,7 @@ import pandas as pd
|
||||
from datetime import datetime
|
||||
import logging
|
||||
import os
|
||||
from app.config import DB_CONFIG, TABLE_NAME
|
||||
from app.config import SQLALCHEMY_DATABASE_URI, TABLE_NAME
|
||||
from app.utils.logger import logger
|
||||
|
||||
class DataLoader:
|
||||
@@ -20,8 +20,7 @@ class DataLoader:
|
||||
"""Establish database connection."""
|
||||
try:
|
||||
logger.info("Attempting to connect to database...")
|
||||
DATABASE_URL = f"postgresql://{DB_CONFIG['user']}:{DB_CONFIG['password']}@{DB_CONFIG['host']}:{DB_CONFIG['port']}/{DB_CONFIG['name']}"
|
||||
self.engine = create_engine(DATABASE_URL)
|
||||
self.engine = create_engine(SQLALCHEMY_DATABASE_URI)
|
||||
with self.engine.connect() as conn:
|
||||
# First check if table exists
|
||||
check_table = text(f"SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = '{TABLE_NAME}')")
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
# Database and ORM
|
||||
sqlalchemy>=2.0.0
|
||||
oracledb>=1.0.0
|
||||
|
||||
|
||||
pandas>=1.5.0
|
||||
numpy>=1.21.0
|
||||
matplotlib>=3.5.0
|
||||
|
||||
Reference in New Issue
Block a user