Beispiel #1
0
            else:
                stat = f'API data fetch failed for query - {query} and error - {query_errors[0]}. Check the query and try ' \
                       f'calling the API manually. '
                logging.error(stat)
                c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                               (l_run_id, err, stag, stat))
                c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL',
                               (l_run_id, 'F'))
                c_log.close()
                conn.close()
                hdlr.close()
                sys.exit()

            flag_status = paginate_all_rows_batch(l_run_id, c_log, batch,
                                                  sql_insert_test_folder, df,
                                                  entity_type,
                                                  fields_test_folder,
                                                  flag_status, hdlr,
                                                  fields_clob_test_folder)
            stat = 'Function call paginate_all_rows completed.'
            logging.info(stat)
            c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                           (l_run_id, info, stag, stat))
    except:
        stat = 'Function call paginate_all_rows failed. Check the traceback for more info'
        logging.exception(stat)
        c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                       (l_run_id, err, stag, stat))
        c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
        c_log.close()
        conn.close()
        hdlr.close()
                        stat = f'API data fetch failed for query - {query} and error - {query_errors[0]}. Check the query and try ' \
                               f'calling the API manually. '
                        logging.error(stat)
                        c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                                       (l_run_id, err, stag, stat))
                        c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL',
                                       (l_run_id, 'F'))
                        c_log.close()
                        conn.close()
                        hdlr.close()
                        sys.exit()

                    # Call the driver function
                    flag_status = paginate_all_rows_batch(
                        l_run_id, c_log, batch,
                        sql_insert_dim_grp[entity_type_dim], df,
                        entity_type_dim, fields_dim_grp[entity_type_dim],
                        flag_status, hdlr,
                        fields_clob_dim_grp[entity_type_dim])
                    stat = 'Function call paginate_all_rows completed.'
                    logging.info(stat)
                    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                                   (l_run_id, info, stag, stat))
            except:
                stat = 'Function call paginate_all_rows failed. Check the traceback for more info'
                logging.exception(stat)
                c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL',
                               (l_run_id, err, stag, stat))
                c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL',
                               (l_run_id, 'F'))
                c_log.close()
                conn.close()
Beispiel #3
0
                    c_log.close()
                    conn.close()
                    hdlr.close()
                    sys.exit()
            else:
                stat = f'API data fetch failed for query - {query} and error - {query_errors[0]}. Check the query and try ' \
                       f'calling the API manually. '
                logging.error(stat)
                c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
                c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
                c_log.close()
                conn.close()
                hdlr.close()
                sys.exit()

            flag_status = paginate_all_rows_batch(l_run_id, c_log, batch, sql_insert_disc, df, entity_type,
                                                  fields_disc, flag_status, hdlr, fields_clob_disc)
            stat = 'Function call paginate_all_rows completed.'
            logging.info(stat)
            c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag, stat))
    except:
        stat = 'Function call paginate_all_rows failed. Check the traceback for more info'
        logging.exception(stat)
        c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
        c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
        c_log.close()
        conn.close()
        hdlr.close()
        sys.exit()


if total_records_fetched == 0:
Beispiel #4
0
                    c_log.close()
                    conn.close()
                    hdlr.close()
                    sys.exit()
            else:
                stat = f'API data fetch failed for query - {query} and error - {query_errors[0]}. Check the query and try ' \
                       f'calling the API manually. '
                logging.error(stat)
                c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
                c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
                c_log.close()
                conn.close()
                hdlr.close()
                sys.exit()

            flag_status = paginate_all_rows_batch(l_run_id, c_log, batch, sql_insert_user_iter_cap, df, entity_type,
                                                  fields_user_iter_cap, flag_status, hdlr, fields_clob_user_iter_cap)
            stat = 'Function call paginate_all_rows completed.'
            logging.info(stat)
            c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag, stat))
    except:
        stat = 'Function call paginate_all_rows failed. Check the traceback for more info'
        logging.exception(stat)
        c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
        c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
        c_log.close()
        conn.close()
        hdlr.close()
        sys.exit()

if total_records_fetched == 0:
    stat = f'No matches found for given query - {query} , in the API call. ' \