src/dirbs/importer/abstract_importer.py
def _upload_file_to_staging_table(self, input_filename):
        """Method to upload a single batch to the staging table."""
        conn = getattr(AbstractImporter._thread_local_storage, 'conn', None)
        if conn is None:
            conn = AbstractImporter._thread_local_storage.conn = create_db_connection(self._db_config)

        with open(input_filename, 'r') as f, conn, conn.cursor() as cursor:
            cursor.copy_expert(sql=self._upload_batch_to_staging_table_query(), file=f)
            return cursor.rowcount
Method to upload a single batch to the staging table.
Method to upload a single batch to the staging table.
Method to upload a single batch to the staging table .
def _upload_file_to_staging_table(self, input_filename):
        conn = getattr(AbstractImporter._thread_local_storage, 'conn', None)
        if conn is None:
            conn = AbstractImporter._thread_local_storage.conn = create_db_connection(self._db_config)
        with open(input_filename, 'r') as f, conn, conn.cursor() as cursor:
            cursor.copy_expert(sql=self._upload_batch_to_staging_table_query(), file=f)
            return cursor.rowcount
def _upload_file_to_staging_table ( self , input_filename ) : conn = getattr ( AbstractImporter . _thread_local_storage , 'conn' , None ) if conn is None : conn = AbstractImporter . _thread_local_storage . conn = create_db_connection ( self . _db_config ) with open ( input_filename , 'r' ) as f , conn , conn . cursor ( ) as cursor : cursor . copy_expert ( sql = self . _upload_batch_to_staging_table_query ( ) , file = f ) return cursor . rowcount
Method to upload a single batch to the staging table.
Method to upload a single batch to the staging table .
"""Method to upload a single batch to the staging table."""
self
input_filename