Beispiel #1
0
def dataflow_pipeline_not_set(task):
    return DatabandRuntimeError(
        "dataflow_pipeline at {task} is None. Can't wait on dataflow job completion."
        .format(task=_run_name(task)),
        help_msg=
        "Please set task.pipeline first at '{task}' or change task.dataflow_wait_until_finish flag"
        .format(task=_run_name(task)),
    )
Beispiel #2
0
def unknown_args_in_task_call(parent_task, cls, func_params):
    return DatabandBuildError(
        "You are trying to create %s from %s with *args, please use named arguments only: args=%s"
        % (_run_name(cls), _band_call_str(parent_task), func_params[0]),
        show_exc_info=True,
        help_msg="Check your %s logic" % _band_call_str(parent_task),
    )
Beispiel #3
0
def task_has_missing_outputs_after_execution(task, missing_str):
    return DatabandRuntimeError(
        "Task %s has been executed, but some outputs are missing!\n\t%s" %
        (_safe_task_family(task), missing_str),
        help_msg=
        "Check your implementation of %s, validate that all outputs has been written. "
        "If it's directory, validate that you have _SUCCESS flag "
        "(self.your_task_output.mark_success())" % _run_name(task),
        show_exc_info=False,
    )
Beispiel #4
0
def failed_to_save_value_to_target(ex, task, parameter, target, value):
    if parameter.name == "result":
        return DatabandRuntimeError(
            "Can't save return value of %s to %s': %s"
            % (_parameter_name(task, parameter), target, ex),
            show_exc_info=True,
            nested_exceptions=[ex],
            help_msg="Check your {} return value "
            "and it definition ('{}')".format(
                _run_name(task), parameter.value_type.type
            ),
        )
    return DatabandRuntimeError(
        "Can't save %s to %s': %s" % (_parameter_name(task, parameter), target, ex),
        show_exc_info=True,
        nested_exceptions=[ex],
        help_msg="Check your %s logic. " % task.friendly_task_name,
    )
Beispiel #5
0
def wrong_return_value_len(task, names, result):
    return DatabandRuntimeError(
        "Returned result from '{task}' doesn't match expected schema. "
        "Expected tuple of '{names}', got tuple of length '{result}'".format(
            task=_run_name(task), names=names, result=len(result)))
Beispiel #6
0
def wrong_return_value_type(task, names, result):
    return DatabandRuntimeError(
        "Returned value from '{task}' should be tupel/list/dict as task has multiple result."
        "Expected tuple of '{names}', got value of type '{result}'".format(
            task=_run_name(task), names=names, result=type(result)))