Esempio n. 1
0
def test_step_context_to_step_run_ref():
    with DagsterInstance.ephemeral() as instance:
        step_context = initialize_step_context("", instance)
        step = step_context.step
        step_run_ref = step_context_to_step_run_ref(step_context, 0)
        assert step_run_ref.run_config == step_context.pipeline_run.run_config
        assert step_run_ref.run_id == step_context.pipeline_run.run_id

        rehydrated_step_context = step_run_ref_to_step_context(
            step_run_ref, instance)
        rehydrated_step = rehydrated_step_context.step
        assert rehydrated_step.pipeline_name == step.pipeline_name
        assert rehydrated_step.step_inputs == step.step_inputs
        assert rehydrated_step.step_outputs == step.step_outputs
        assert rehydrated_step.kind == step.kind
        assert rehydrated_step.solid_handle.name == step.solid_handle.name
        assert rehydrated_step.logging_tags == step.logging_tags
        assert rehydrated_step.tags == step.tags
Esempio n. 2
0
def test_step_context_to_step_run_ref():
    step_context = initialize_step_context('')
    step = step_context.step
    step_run_ref = step_context_to_step_run_ref(step_context, 0)
    assert step_run_ref.run_config == step_context.pipeline_run.run_config
    assert step_run_ref.run_id == step_context.pipeline_run.run_id

    rehydrated_step_context = step_run_ref_to_step_context(step_run_ref)
    assert rehydrated_step_context.required_resource_keys == step_context.required_resource_keys
    rehydrated_step = rehydrated_step_context.step
    assert rehydrated_step.pipeline_name == step.pipeline_name
    assert rehydrated_step.key_suffix == step.key_suffix
    assert rehydrated_step.step_inputs == step.step_inputs
    assert rehydrated_step.step_outputs == step.step_outputs
    assert rehydrated_step.kind == step.kind
    assert rehydrated_step.solid_handle.name == step.solid_handle.name
    assert rehydrated_step.logging_tags == step.logging_tags
    assert rehydrated_step.tags == step.tags