src/dirbs/metadata.py
def add_optional_job_metadata(conn, job_command, run_id, **new_metadata):
    """
    Log additional JSON metadata about this job but leave core fields unchanged.

    Arguments:
        conn: dirbs db connection object
        job_command: name of the command for current job
        run_id: id of the currently running job
        new_metadata: key-value pairs containing optional metadata to store about the job
    """
    # An auto-commit connection must be used to ensure the log is not rolled back due to any reason, it
    # must be preserved.
    assert conn.autocommit
    with conn.cursor() as cursor:
        cursor.execute("""UPDATE job_metadata
                             SET extra_metadata = extra_metadata || %s
                           WHERE command = %s
                             AND run_id = %s""",
                       [json.dumps(new_metadata), job_command, run_id])
        assert cursor.rowcount == 1

    Log additional JSON metadata about this job but leave core fields unchanged.

    Arguments:
        conn: dirbs db connection object
        job_command: name of the command for current job
        run_id: id of the currently running job
        new_metadata: key-value pairs containing optional metadata to store about the job
    
Log additional JSON metadata about this job but leave core fields unchanged.
Log additional JSON metadata about this job but leave core fields unchanged .
def add_optional_job_metadata(conn, job_command, run_id, **new_metadata):
    assert conn.autocommit
    with conn.cursor() as cursor:
        cursor.execute("""UPDATE job_metadata
                             SET extra_metadata = extra_metadata || %s
                           WHERE command = %s
                             AND run_id = %s""",
                       [json.dumps(new_metadata), job_command, run_id])
        assert cursor.rowcount == 1
def add_optional_job_metadata ( conn , job_command , run_id , ** new_metadata ) : assert conn . autocommit with conn . cursor ( ) as cursor : cursor . execute ( """UPDATE job_metadata
                             SET extra_metadata = extra_metadata || %s
                           WHERE command = %s
                             AND run_id = %s""" , [ json . dumps ( new_metadata ) , job_command , run_id ] ) assert cursor . rowcount == 1
Log additional JSON metadata about this job but leave core fields unchanged.
Log additional JSON metadata about this job but leave core fields unchanged .
"""
    Log additional JSON metadata about this job but leave core fields unchanged.

    Arguments:
        conn: dirbs db connection object
        job_command: name of the command for current job
        run_id: id of the currently running job
        new_metadata: key-value pairs containing optional metadata to store about the job
    """ # An auto-commit connection must be used to ensure the log is not rolled back due to any reason, it # must be preserved.
conn
dirbs db connection object
dirbs db connection object
job_command
name of the command for current job
name of the command for current job
run_id
id of the currently running job
id of the currently running job
new_metadata
key-value pairs containing optional metadata to store about the job
key - value pairs containing optional metadata to store about the job