Skip to content

Commit

Permalink
remove download/main.py dependency on latest version of sqlalchemy
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglimEar committed Nov 3, 2023
1 parent b6dfe8e commit ff5adfe
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion download/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
import json
import pandas as pd
from sqlalchemy import create_engine
#from sqlalchemy import create_engine
from model.a_contributions import A_Contributions
from model.committee import Committees
from model.election import Elections
Expand Down
158 changes: 79 additions & 79 deletions download/model/a_contributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Hopefully this can be joined with other Schedule classes into a single Transaction class
"""
import pandas as pd
from sqlalchemy.types import BOOLEAN, DATE, DOUBLE_PRECISION, INTEGER, TIME, VARCHAR
#from sqlalchemy.types import BOOLEAN, DATE, DOUBLE_PRECISION, INTEGER, TIME, VARCHAR
from .base import BaseModel

class A_Contributions(BaseModel):
Expand Down Expand Up @@ -123,82 +123,82 @@ def __init__(
'Loan_Rate': 'string',
'Int_CmteId': 'Int64'
}
self._sql_dtypes = {
'Filer_ID': VARCHAR(9),
'Filer_NamL': VARCHAR(183),
'Report_Num': INTEGER,
'Committee_Type': VARCHAR(64),
'Rpt_Date': DATE,
'From_Date': DATE,
'Thru_Date': DATE,
'Elect_Date': DATE,
'tblCover_Office_Cd': VARCHAR(64),
'tblCover_Offic_Dscr': VARCHAR(64),
'Rec_Type': VARCHAR(4),
'Form_Type': TIME,
'Tran_ID': VARCHAR(12),
'Entity_Cd': VARCHAR(3),
'Tran_NamL': VARCHAR(199),
'Tran_NamF': VARCHAR(38),
'Tran_NamT': VARCHAR(6),
'Tran_NamS': VARCHAR(5),
'Tran_Adr1': VARCHAR(64),
'Tran_Adr2': VARCHAR(64),
'Tran_City': VARCHAR(50),
'Tran_State': VARCHAR(4),
'Tran_Zip4': VARCHAR(10),
'Tran_Emp': VARCHAR(92),
'Tran_Occ': VARCHAR(60),
'Tran_Self': BOOLEAN,
'Tran_Type': VARCHAR(4),
'Tran_Date': DATE,
'Tran_Date1': DATE,
'Tran_Amt1': DOUBLE_PRECISION,
'Tran_Amt2': DOUBLE_PRECISION,
'Tran_Dscr': VARCHAR(56),
'Cmte_ID': VARCHAR(9),
'Tres_NamL': VARCHAR(4),
'Tres_NamF': VARCHAR(4),
'Tres_NamT': VARCHAR(64),
'Tres_NamS': VARCHAR(64),
'Tres_Adr1': VARCHAR(64),
'Tres_Adr2': VARCHAR(64),
'Tres_City': VARCHAR(7),
'Tres_State': VARCHAR(4),
'Tres_Zip': INTEGER,
'Intr_NamL': VARCHAR(74),
'Intr_NamF': VARCHAR(6),
'Intr_NamT': VARCHAR(64),
'Intr_NamS': VARCHAR(64),
'Intr_Adr1': VARCHAR(64),
'Intr_Adr2': VARCHAR(64),
'Intr_City': VARCHAR(13),
'Intr_State': VARCHAR(4),
'Intr_Zip4': VARCHAR(10),
'Intr_Emp': VARCHAR(15),
'Intr_Occ': VARCHAR(8),
'Intr_Self': BOOLEAN,
'Cand_NamL': VARCHAR(64),
'Cand_NamF': VARCHAR(64),
'Cand_NamT': VARCHAR(64),
'Cand_NamS': VARCHAR(64),
'tblDetlTran_Office_Cd': VARCHAR(4),
'tblDetlTran_Offic_Dscr': VARCHAR(19),
'Juris_Cd': VARCHAR(4),
'Juris_Dscr': VARCHAR(64),
'Dist_No': VARCHAR(64),
'Off_S_H_Cd': VARCHAR(64),
'Bal_Name': VARCHAR(64),
'Bal_Num': VARCHAR(4),
'Bal_Juris': VARCHAR(64),
'Sup_Opp_Cd': VARCHAR(64),
'Memo_Code': VARCHAR(64),
'Memo_RefNo': VARCHAR(11),
'BakRef_TID': VARCHAR(64),
'XRef_SchNm': VARCHAR(64),
'XRef_Match': VARCHAR(64),
'Loan_Rate': VARCHAR(64),
'Int_CmteId': INTEGER
}
self._sql_cols = list(self._sql_dtypes.keys())
#self._sql_dtypes = {
# 'Filer_ID': VARCHAR(9),
# 'Filer_NamL': VARCHAR(183),
# 'Report_Num': INTEGER,
# 'Committee_Type': VARCHAR(64),
# 'Rpt_Date': DATE,
# 'From_Date': DATE,
# 'Thru_Date': DATE,
# 'Elect_Date': DATE,
# 'tblCover_Office_Cd': VARCHAR(64),
# 'tblCover_Offic_Dscr': VARCHAR(64),
# 'Rec_Type': VARCHAR(4),
# 'Form_Type': TIME,
# 'Tran_ID': VARCHAR(12),
# 'Entity_Cd': VARCHAR(3),
# 'Tran_NamL': VARCHAR(199),
# 'Tran_NamF': VARCHAR(38),
# 'Tran_NamT': VARCHAR(6),
# 'Tran_NamS': VARCHAR(5),
# 'Tran_Adr1': VARCHAR(64),
# 'Tran_Adr2': VARCHAR(64),
# 'Tran_City': VARCHAR(50),
# 'Tran_State': VARCHAR(4),
# 'Tran_Zip4': VARCHAR(10),
# 'Tran_Emp': VARCHAR(92),
# 'Tran_Occ': VARCHAR(60),
# 'Tran_Self': BOOLEAN,
# 'Tran_Type': VARCHAR(4),
# 'Tran_Date': DATE,
# 'Tran_Date1': DATE,
# 'Tran_Amt1': DOUBLE_PRECISION,
# 'Tran_Amt2': DOUBLE_PRECISION,
# 'Tran_Dscr': VARCHAR(56),
# 'Cmte_ID': VARCHAR(9),
# 'Tres_NamL': VARCHAR(4),
# 'Tres_NamF': VARCHAR(4),
# 'Tres_NamT': VARCHAR(64),
# 'Tres_NamS': VARCHAR(64),
# 'Tres_Adr1': VARCHAR(64),
# 'Tres_Adr2': VARCHAR(64),
# 'Tres_City': VARCHAR(7),
# 'Tres_State': VARCHAR(4),
# 'Tres_Zip': INTEGER,
# 'Intr_NamL': VARCHAR(74),
# 'Intr_NamF': VARCHAR(6),
# 'Intr_NamT': VARCHAR(64),
# 'Intr_NamS': VARCHAR(64),
# 'Intr_Adr1': VARCHAR(64),
# 'Intr_Adr2': VARCHAR(64),
# 'Intr_City': VARCHAR(13),
# 'Intr_State': VARCHAR(4),
# 'Intr_Zip4': VARCHAR(10),
# 'Intr_Emp': VARCHAR(15),
# 'Intr_Occ': VARCHAR(8),
# 'Intr_Self': BOOLEAN,
# 'Cand_NamL': VARCHAR(64),
# 'Cand_NamF': VARCHAR(64),
# 'Cand_NamT': VARCHAR(64),
# 'Cand_NamS': VARCHAR(64),
# 'tblDetlTran_Office_Cd': VARCHAR(4),
# 'tblDetlTran_Offic_Dscr': VARCHAR(19),
# 'Juris_Cd': VARCHAR(4),
# 'Juris_Dscr': VARCHAR(64),
# 'Dist_No': VARCHAR(64),
# 'Off_S_H_Cd': VARCHAR(64),
# 'Bal_Name': VARCHAR(64),
# 'Bal_Num': VARCHAR(4),
# 'Bal_Juris': VARCHAR(64),
# 'Sup_Opp_Cd': VARCHAR(64),
# 'Memo_Code': VARCHAR(64),
# 'Memo_RefNo': VARCHAR(11),
# 'BakRef_TID': VARCHAR(64),
# 'XRef_SchNm': VARCHAR(64),
# 'XRef_Match': VARCHAR(64),
# 'Loan_Rate': VARCHAR(64),
# 'Int_CmteId': INTEGER
#}
#self._sql_cols = list(self._sql_dtypes.keys())
self._sql_table_name = 'A-Contributions'

0 comments on commit ff5adfe

Please sign in to comment.