Skip to content

Commit

Permalink
[expectations] Final IOExpectationResult changes
Browse files Browse the repository at this point in the history
Summary:
- Removed unuseful test
- Added reference to issue in dagster-ge

Test Plan: buildkite

Reviewers: #ft, schrockn

Reviewed By: #ft, schrockn

Differential Revision: https://dagster.phacility.com/D598
  • Loading branch information
helloworld committed Jul 12, 2019
1 parent 558be4e commit 87188ce
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
|
|--> SystemStepExecutionContext (produced by .for_step() on pipeline context)
|
<<<<<<< HEAD
|--> SystemComputeExecutionContext (produced by .for_compute() on step context)
|
|--> SystemExpectationExecutionContext (produced by .for_expectation() on step context)
=======
|--> SystemComputeExecutionContext (produced by .for_transform() on step context)
>>>>>>> [expectations] Delete IOExpectationDefinition and related classes
====================================================================================================
In the system contexts, immutable state is stored in SystemPipelineExecutionContextData, and any
Expand Down
173 changes: 0 additions & 173 deletions python_modules/dagster/dagster/core/execution/plan/expectations.py

This file was deleted.

6 changes: 3 additions & 3 deletions python_modules/dagster/dagster/core/execution/plan/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _build_from_sorted_solids(
# Create and add execution plan steps (and output handles) for solid outputs
for name, output_def in solid.definition.output_dict.items():
subplan = create_subplan_for_output(
self.pipeline_name, solid, terminal_transform_step, output_def
self.pipeline_name, solid, terminal_compute_step, output_def
)
self.add_steps(subplan.steps)

Expand All @@ -166,14 +166,14 @@ def _build_from_sorted_solids(
return terminal_compute_step


def create_subplan_for_output(pipeline_name, solid, solid_transform_step, output_def):
def create_subplan_for_output(pipeline_name, solid, solid_compute_step, output_def):
check.str_param(pipeline_name, 'pipeline_name')
check.inst_param(solid, 'solid', Solid)
check.inst_param(solid_compute_step, 'solid_compute_step', ExecutionStep)
check.inst_param(output_def, 'output_def', OutputDefinition)

output_def = solid.definition.resolve_output_to_origin(output_def.name)
terminal_step_output_handle = StepOutputHandle.from_step(solid_transform_step, output_def.name)
terminal_step_output_handle = StepOutputHandle.from_step(solid_compute_step, output_def.name)
return ExecutionValueSubplan.empty(terminal_step_output_handle)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
DagsterInvariantViolationError,
DagsterStepOutputNotFoundError,
DependencyDefinition,
ExpectationResult,
InputDefinition,
Output,
OutputDefinition,
Expand Down Expand Up @@ -41,41 +40,6 @@ def _t_fn(*_args):
solid_result.output_value('not_defined')


def test_multiple_outputs_expectations():
called = {}

def _expect_fn_one(*_args, **_kwargs):
called['expectation_one'] = True
return True

def _expect_fn_two(*_args, **_kwargs):
called['expectation_two'] = True
return True

def _compute_fn(*_args, **_kwargs):
output_one_val = 'foo'
output_two_val = 'bar'
yield ExpectationResult(label='some_expectation', success=_expect_fn_one(output_one_val))
yield ExpectationResult(label='some_expectation', success=_expect_fn_two(output_two_val))
yield Output(output_one_val, 'output_one')
yield Output(output_two_val, 'output_two')

solid = SolidDefinition(
name='multiple_outputs',
input_defs=[],
output_defs=[OutputDefinition(name='output_one'), OutputDefinition(name='output_two')],
compute_fn=_compute_fn,
)

pipeline = PipelineDefinition(solid_defs=[solid])

result = execute_pipeline(pipeline)

assert result.success
assert called['expectation_one']
assert called['expectation_two']


def test_wrong_multiple_output():
def _t_fn(*_args):
yield Output(output_name='mismatch', value='foo')
Expand Down
2 changes: 2 additions & 0 deletions python_modules/libraries/dagster-ge/dagster_ge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TODO: This module should be rebuilt on top of ExpectationResult
# see: https://github.com/dagster-io/dagster/issues/1546

0 comments on commit 87188ce

Please sign in to comment.