Exemple #1
0
def test_faculty_run_to_mlflow_run_parent_run_id_backwards_compatability(
        faculty_attribute, faculty_tag_value, mlflow_tag_value):
    """Test logic setting parent run ID tag when not available."""

    if faculty_tag_value is None:
        extra_tags = []
    else:
        extra_tags = [FacultyTag(MLFLOW_PARENT_RUN_ID, faculty_tag_value)]
    faculty_run = FACULTY_RUN._replace(parent_run_id=faculty_attribute,
                                       tags=FACULTY_RUN.tags + extra_tags)

    if mlflow_tag_value is None:
        parent_run_id_tag = None
    else:
        parent_run_id_tag = RunTag(MLFLOW_PARENT_RUN_ID, mlflow_tag_value)
    expected_run = mlflow_run(parent_run_id_tag=parent_run_id_tag)

    assert run_equals(faculty_run_to_mlflow_run(faculty_run), expected_run)
Exemple #2
0
def test_faculty_run_to_mlflow_run_name_backwards_compatability(
        faculty_attribute, faculty_tag_value, mlflow_attribute,
        mlflow_tag_value):
    """Test logic setting run name tag when not available."""

    if faculty_tag_value is None:
        extra_tags = []
    else:
        extra_tags = [FacultyTag(MLFLOW_RUN_NAME, faculty_tag_value)]
    faculty_run = FACULTY_RUN._replace(name=faculty_attribute,
                                       tags=FACULTY_RUN.tags + extra_tags)

    if mlflow_tag_value is None:
        name_tag = None
    else:
        name_tag = RunTag(MLFLOW_RUN_NAME, mlflow_tag_value)
    expected_run = mlflow_run(name=mlflow_attribute, name_tag=name_tag)

    assert run_equals(faculty_run_to_mlflow_run(faculty_run), expected_run)
Exemple #3
0
def test_faculty_run_to_mlflow_run(
    faculty_run_status,
    mlflow_run_status,
    deleted_at,
    lifecycle_stage,
    faculty_ended_at,
    mlflow_end_time,
):
    faculty_run = FACULTY_RUN._replace(
        status=faculty_run_status,
        deleted_at=deleted_at,
        ended_at=faculty_ended_at,
    )

    expected_mlflow_run = mlflow_run(
        status=mlflow_run_status,
        end_time=mlflow_end_time,
        lifecycle_stage=lifecycle_stage,
    )

    assert run_equals(faculty_run_to_mlflow_run(faculty_run),
                      expected_mlflow_run)