qcodes/dataset/database_extract_runs.py
def _extract_single_dataset_into_db(dataset: DataSet,
                                    target_conn: ConnectionPlus,
                                    target_exp_id: int) -> None:
    """
    NB: This function should only be called from within
    meth:`extract_runs_into_db`

    Insert the given dataset into the specified database file as the latest
    run.

    Trying to insert a run already in the DB is a NOOP.

    Args:
        dataset: A dataset representing the run to be copied
        target_conn: connection to the DB. Must be atomically guarded
        target_exp_id: The ``exp_id`` of the (target DB) experiment in which to
          insert the run
    """

    if not dataset.completed:
        raise ValueError('Dataset not completed. An incomplete dataset '
                         'can not be copied. The incomplete dataset has '
                         f'GUID: {dataset.guid} and run_id: {dataset.run_id}')

    source_conn = dataset.conn

    run_id = get_runid_from_guid(target_conn, dataset.guid)

    if run_id is not None:
        return

    target_table_name = _add_run_to_runs_table(dataset, target_conn, target_exp_id)
    assert target_table_name is not None
    _populate_results_table(
        source_conn, target_conn, dataset.table_name, target_table_name
    )

    NB: This function should only be called from within
    meth:`extract_runs_into_db`

    Insert the given dataset into the specified database file as the latest
    run.

    Trying to insert a run already in the DB is a NOOP.

    Args:
        dataset: A dataset representing the run to be copied
        target_conn: connection to the DB. Must be atomically guarded
        target_exp_id: The ``exp_id`` of the (target DB) experiment in which to
          insert the run
    
This function should only be called from within
meth:`extract_runs_into_db`

Insert the given dataset into the specified database file as the latest
run.

Trying to insert a run already in the DB is a NOOP.
This function should only be called from within meth : ` extract_runs_into_db ` Insert the given dataset into the specified database file as the latest run . Trying to insert a run already in the DB is a NOOP .
def _extract_single_dataset_into_db(dataset: DataSet,
                                    target_conn: ConnectionPlus,
                                    target_exp_id: int) -> None:
    if not dataset.completed:
        raise ValueError('Dataset not completed. An incomplete dataset '
                         'can not be copied. The incomplete dataset has '
                         f'GUID: {dataset.guid} and run_id: {dataset.run_id}')
    source_conn = dataset.conn
    run_id = get_runid_from_guid(target_conn, dataset.guid)
    if run_id is not None:
        return
    target_table_name = _add_run_to_runs_table(dataset, target_conn, target_exp_id)
    assert target_table_name is not None
    _populate_results_table(
        source_conn, target_conn, dataset.table_name, target_table_name
    )
def _extract_single_dataset_into_db ( dataset : DataSet , target_conn : ConnectionPlus , target_exp_id : int ) -> None : if not dataset . completed : raise ValueError ( 'Dataset not completed. An incomplete dataset ' 'can not be copied. The incomplete dataset has ' f'GUID: {dataset.guid} and run_id: {dataset.run_id}' ) source_conn = dataset . conn run_id = get_runid_from_guid ( target_conn , dataset . guid ) if run_id is not None : return target_table_name = _add_run_to_runs_table ( dataset , target_conn , target_exp_id ) assert target_table_name is not None _populate_results_table ( source_conn , target_conn , dataset . table_name , target_table_name )
NB: This function should only be called from within
meth:`extract_runs_into_db`
NB : This function should only be called from within meth : ` extract_runs_into_db `
"""
    NB: This function should only be called from within
    meth:`extract_runs_into_db`

    Insert the given dataset into the specified database file as the latest
    run.

    Trying to insert a run already in the DB is a NOOP.

    Args:
        dataset: A dataset representing the run to be copied
        target_conn: connection to the DB. Must be atomically guarded
        target_exp_id: The ``exp_id`` of the (target DB) experiment in which to
          insert the run
    """
dataset
DataSet
A dataset representing the run to be copied
A dataset representing the run to be copied
target_conn
ConnectionPlus
connection to the DB. Must be atomically guarded
connection to the DB . Must be atomically guarded
target_exp_id
int
The ``exp_id`` of the (target DB) experiment in which to
insert the run
The ` ` exp_id ` ` of the ( target DB ) experiment in which to insert the run