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
15 lines
374 B
Python
15 lines
374 B
Python
import pandas as pd
|
|
|
|
from option_pricing.src.data.ingestion.db_connect import db_engine
|
|
|
|
|
|
def fetch_underlyings() -> pd.DataFrame:
|
|
"""
|
|
Fetch all entries from the underlyings table using configured DB credentials.
|
|
"""
|
|
engine = db_engine()
|
|
return pd.read_sql("SELECT * FROM underlyings;", engine)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print(fetch_underlyings()) |