def testjiraapidata(): jira_data_path = "C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\JIRAData\\JIRAData_07102020.csv" jira_data = DataReader.Read(jira_data_path) pkey = TSQLInterface.PrimaryKeys(jira_data, 4, findFirst=True) comp = DataComparer() # Test locally: #interface = TSQLInterface('.', 'MetricsDyetl') #interface.Insert(jira_data, 'JIRAData') #compare_data = interface.Select("SELECT * FROM JIRAData") #comp.GenerateComparisonReport('C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\JIRAData\\JIRADataComp_LOCAL.xlsx', compare_data, jira_data, pKey = pkey) # Test QA: #interface = TSQLInterface('nj1qasql13', 'MetricsDyetl') #interface.Insert(jira_data, 'JIRAData') #compare_data = interface.Select("SELECT * FROM JIRAData") #comp.GenerateComparisonReport('C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\JIRAData\\JIRADataComp_QA.xlsx', compare_data, jira_data, pKey = pkey) # Test UAT: #interface = TSQLInterface('nj1uatsql13', 'MetricsDyetl') #interface.Insert(jira_data, 'JIRAData') #compare_data = interface.Select("SELECT * FROM JIRAData") #comp.GenerateComparisonReport('C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\JIRAData\\JIRADataComp_UAT.xlsx', compare_data, jira_data, pKey = pkey) # Test STG: interface = TSQLInterface('nj1stgsql13', 'MetricsDyetl') interface.Insert(jira_data, 'JIRAData') compare_data = interface.Select("SELECT * FROM JIRAData") comp.GenerateComparisonReport( 'C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\JIRAData\\JIRADataComp_STG.xlsx', compare_data, jira_data, pKey=pkey)
def insert(): interface = TSQLInterface('nj1qasql13', 'MetricsDyetl') data = DataReader.Read( 'C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\GS.SecurityExceptions.v1\\SecurityExceptionsComp.csv' ) interface.Insert(data, 'tbl_CyberSecurity_Exceptions_GS') out = interface.Select( "SELECT * FROM tbl_CyberSecurity_Exceptions_GS where fileDate = '2020-04-13'" ) return out
def genreportwitherrors(): path = "C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\GEMS.DyEtl.InternalAudit.GSIBPhysicalAccessKnownExceptions.v1\\GS IB Physical Access Known Exceptions_20200115.xlsx" errpath = "C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\GEMS.DyEtl.InternalAudit.GSIBPhysicalAccessKnownExceptions.v1\\GS IB Physical Access Known Exceptions_20200115_Errs.xlsx" insertdata = DataReader.Read(path) testdata = DataReader.Read(errpath) interface = TSQLInterface('.', 'MetricsDyetl') interface.Insert(insertdata, 'InternalAudit_GSIBPhysicalAccessKnownExceptions') tabledata = interface.Select( "SELECT * FROM InternalAudit_GSIBPhysicalAccessKnownExceptions") comp = DataComparer() path = "C:\\Users\\berutan\\Desktop\\Projects\\New ETL\\GEMS.DyEtl.InternalAudit.GSIBPhysicalAccessKnownExceptions.v1\\GS IB Physical Access Known Exceptions_ERRS.xlsx" pKey = TSQLInterface.PrimaryKeys(insertdata, findFirst=True) ignoreCols = ['FileDate', 'RunDate'] comp.GenerateComparisonReport(path, tabledata, testdata, ignoreCols, pKey=pKey)