Skip to content

Commit

Permalink
'final_update'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvaneshkm committed Jun 16, 2024
1 parent 458cb0d commit 0329e35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/dbsconnector/databases.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# importing necessary libraries
import pandas as pd
from pathlib import Path
from pymysql import connect
import pymysql
from pymongo.mongo_client import MongoClient
from typing import Optional


# load csv file:
Expand All @@ -24,9 +25,11 @@ def load_gsheet(gsheet_id:str, sheet_name:str):

# load mysql data:
def load_mysqldata(host:str, user:str, password:str, database:str, table:str):
db = connect(host=host, user=user, passwd=password, database=database)
db: Optional[pymysql.Connection] = None
db = pymysql.connect(host=host, user=user, passwd=password, database=database)
cur = db.cursor()
query = f'select * from {table}'
cur.close()
return pd.read_sql(query, db)

# load mongodb data:
Expand Down

0 comments on commit 0329e35

Please sign in to comment.