Replace hardcoded DB credentials with environment-driven configuration.
Centralize DB settings in ingestion config, remove embedded secrets from ingestion helpers, and add an idempotent PostgreSQL bootstrap script to create role/database and apply schema safely. Made-with: Cursor
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
from datetime import datetime, timezone
|
||||
from decimal import Decimal, InvalidOperation
|
||||
|
||||
import pandas as pd
|
||||
import yfinance as yf
|
||||
from sqlalchemy import create_engine, text
|
||||
from sqlalchemy import text
|
||||
|
||||
from config.settings import DB_CONFIG, PIPELINE_CONFIG
|
||||
from option_pricing.src.data.ingestion.config import DB_CONFIG, PIPELINE_CONFIG
|
||||
from db_connect import db_engine
|
||||
|
||||
|
||||
def build_db_url() -> str:
|
||||
@@ -269,8 +269,7 @@ def ingest_symbol(symbol: str, engine):
|
||||
|
||||
|
||||
def main():
|
||||
db_url = build_db_url()
|
||||
engine = create_engine(db_url, future=True)
|
||||
engine = db_engine()
|
||||
|
||||
for symbol in PIPELINE_CONFIG["symbols"]:
|
||||
ingest_symbol(symbol, engine)
|
||||
|
||||
Reference in New Issue
Block a user