def commit_results_data(self): """ This function writes all KPI results to the DB, and commits the changes. """ cur = self.rds_conn.db.cursor() delete_queries = DIAGEOQueries.get_delete_session_results_query_old_tables(self.session_uid) for query in delete_queries: cur.execute(query) for query in self.kpi_results_queries: cur.execute(query) self.rds_conn.db.commit()
def commit_results_data(self): """ This function writes all KPI results to the DB, and commits the changes. """ insert_queries = self.merge_insert_queries(self.kpi_results_queries) rds_conn = PSProjectConnector(self.project_name, DbUsers.CalculationEng) cur = rds_conn.db.cursor() delete_queries = DIAGEOQueries.get_delete_session_results_query_old_tables( self.session_uid) for query in delete_queries: cur.execute(query) for query in insert_queries: cur.execute(query) rds_conn.db.commit()
def commit_results_data(self): # self.common.commit_results_data_to_new_tables() self.common_v2.commit_results_data() # new tables # old tables cur = self.rds_conn.db.cursor() delete_queries = DIAGEOQueries.get_delete_session_results_query_old_tables( self.session_uid) for query in delete_queries: cur.execute(query) for query in self.kpi_results_queries: cur.execute(query) # needed to save Touch Point values for query in self.common.kpi_results_queries: cur.execute(query) # this is only needed temporarily until the global assortment function is updated to use the new commonv2 object insert_queries = self.common.merge_insert_queries( self.common.kpi_results_new_tables_queries) for query in insert_queries: cur.execute(query) self.rds_conn.db.commit()