src/dirbs/cli/catalog.py
def _update_catalog(uncataloged_files, config):
    """
    Write the new and modified files to the data catalog.

    :param uncataloged_files: list of uncataloged files
    :param config: dirbs config
    """
    with create_db_connection(config.db_config) as conn, conn.cursor() as cursor:
        for f in uncataloged_files:
            cursor.execute(sql.SQL("""INSERT INTO data_catalog AS dc(filename, file_type, modified_time,
                                                               compressed_size_bytes, is_valid_zip, is_valid_format,
                                                               md5, extra_attributes, first_seen, last_seen,
                                                               uncompressed_size_bytes, num_records)
                                           VALUES (%s, %s, %s, %s, %s, %s, %s, %s, NOW(), NOW(), %s, %s)
                                      ON CONFLICT (filename, file_type)
                                        DO UPDATE
                                              SET modified_time = %s,
                                                  compressed_size_bytes = %s,
                                                  is_valid_zip = %s,
                                                  is_valid_format = %s,
                                                  md5 = %s,
                                                  extra_attributes = %s,
                                                  last_seen = NOW(),
                                                  uncompressed_size_bytes = %s,
                                                  num_records = %s"""),  # noqa: Q441, Q449
                           [f.filename, f.file_type, f.modified_time, f.compressed_size_bytes,
                            f.is_valid_zip, f.is_valid_format, f.md5, json.dumps(f.extra_attributes),
                            f.uncompressed_size_bytes, f.num_records,
                            f.modified_time, f.compressed_size_bytes, f.is_valid_zip,
                            f.is_valid_format, f.md5, json.dumps(f.extra_attributes), f.uncompressed_size_bytes,
                            f.num_records])

    Write the new and modified files to the data catalog.

    :param uncataloged_files: list of uncataloged files
    :param config: dirbs config
    
Write the new and modified files to the data catalog.
Write the new and modified files to the data catalog .
def _update_catalog(uncataloged_files, config):
    with create_db_connection(config.db_config) as conn, conn.cursor() as cursor:
        for f in uncataloged_files:
            cursor.execute(sql.SQL("""INSERT INTO data_catalog AS dc(filename, file_type, modified_time,
                                                               compressed_size_bytes, is_valid_zip, is_valid_format,
                                                               md5, extra_attributes, first_seen, last_seen,
                                                               uncompressed_size_bytes, num_records)
                                           VALUES (%s, %s, %s, %s, %s, %s, %s, %s, NOW(), NOW(), %s, %s)
                                      ON CONFLICT (filename, file_type)
                                        DO UPDATE
                                              SET modified_time = %s,
                                                  compressed_size_bytes = %s,
                                                  is_valid_zip = %s,
                                                  is_valid_format = %s,
                                                  md5 = %s,
                                                  extra_attributes = %s,
                                                  last_seen = NOW(),
                                                  uncompressed_size_bytes = %s,
                                                  num_records = %s"""),  
                           [f.filename, f.file_type, f.modified_time, f.compressed_size_bytes,
                            f.is_valid_zip, f.is_valid_format, f.md5, json.dumps(f.extra_attributes),
                            f.uncompressed_size_bytes, f.num_records,
                            f.modified_time, f.compressed_size_bytes, f.is_valid_zip,
                            f.is_valid_format, f.md5, json.dumps(f.extra_attributes), f.uncompressed_size_bytes,
                            f.num_records])
def _update_catalog ( uncataloged_files , config ) : with create_db_connection ( config . db_config ) as conn , conn . cursor ( ) as cursor : for f in uncataloged_files : cursor . execute ( sql . SQL ( """INSERT INTO data_catalog AS dc(filename, file_type, modified_time,
                                                               compressed_size_bytes, is_valid_zip, is_valid_format,
                                                               md5, extra_attributes, first_seen, last_seen,
                                                               uncompressed_size_bytes, num_records)
                                           VALUES (%s, %s, %s, %s, %s, %s, %s, %s, NOW(), NOW(), %s, %s)
                                      ON CONFLICT (filename, file_type)
                                        DO UPDATE
                                              SET modified_time = %s,
                                                  compressed_size_bytes = %s,
                                                  is_valid_zip = %s,
                                                  is_valid_format = %s,
                                                  md5 = %s,
                                                  extra_attributes = %s,
                                                  last_seen = NOW(),
                                                  uncompressed_size_bytes = %s,
                                                  num_records = %s""" ) , [ f . filename , f . file_type , f . modified_time , f . compressed_size_bytes , f . is_valid_zip , f . is_valid_format , f . md5 , json . dumps ( f . extra_attributes ) , f . uncompressed_size_bytes , f . num_records , f . modified_time , f . compressed_size_bytes , f . is_valid_zip , f . is_valid_format , f . md5 , json . dumps ( f . extra_attributes ) , f . uncompressed_size_bytes , f . num_records ] )
Write the new and modified files to the data catalog.
Write the new and modified files to the data catalog .
"""
    Write the new and modified files to the data catalog.

    :param uncataloged_files: list of uncataloged files
    :param config: dirbs config
    """ # noqa: Q441, Q449
uncataloged_files
list of uncataloged files
list of uncataloged files
config
None