def query_on_dask_worker(handle, variables, dependencies): # pylint: disable=unused-argument '''Note that we need to pass "dependencies" to ensure Dask sequences futures during task scheduling, even though we do not use this argument within the function. We also set 'raise_on_error' within pipeline execution, because otherwise (currently) very little information is propagated to the dask master from the workers about the state of execution; we should at least inform the user of exceptions. ''' return execute_start_pipeline_execution_query(handle, variables)
def python_callable(ts, dag_run, **kwargs): # pylint: disable=unused-argument run_id = dag_run.run_id # TODO: https://github.com/dagster-io/dagster/issues/1342 redacted = construct_variables(mode, 'REDACTED', pipeline_name, run_id, ts, step_keys) logging.info( 'Executing GraphQL query: {query}\n'.format(query=START_PIPELINE_EXECUTION_QUERY) + 'with variables:\n' + seven.json.dumps(redacted, indent=2) ) return execute_start_pipeline_execution_query( handle, construct_variables(mode, environment_dict, pipeline_name, run_id, ts, step_keys), )
def test_execute_start_pipeline_execution_query(): pipeline_name = 'sleepy_pipeline' handle = ExecutionTargetHandle.for_pipeline_module( 'dagster_examples.toys.sleepy', pipeline_name ) variables = { 'executionParams': { 'environmentConfigData': {}, 'mode': 'default', 'selector': {'name': pipeline_name}, 'executionMetadata': {'runId': '12345'}, } } result = execute_start_pipeline_execution_query(handle, variables) seen_events = set() for event in result: seen_events.add((event.event_type_value, event.step_key)) assert seen_events == EXPECTED_EVENTS