How to use the dbnd.task function in dbnd

To help you get started, we’ve selected a few dbnd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github databand-ai / dbnd / modules / dbnd-airflow / test_dbnd_airflow / airflow_home / dags / dag_with_xcom_pipeline.py View on Github external
@task
def parse_to_string(p_date=None):
    # type: (datetime ) -> str
    split = p_date.isoformat().split("T")
    return "SEPARATOR".join(split)
github databand-ai / dbnd / modules / dbnd / test_dbnd / run / test_inline_calls_deco.py View on Github external
        @task()
        def t_f_2nd(a):
            # type: (DataList[str])-> List[str]
            return t_f_b(a)
github databand-ai / dbnd / modules / dbnd / test_dbnd / task / task_configuration / test_override_and_context.py View on Github external
@task
def task_from_config(parameter_from_config, expected):
    assert parameter_from_config == expected
github databand-ai / dbnd / modules / dbnd / test_dbnd / task / task_data / test_task_inputs_deco.py View on Github external
        @task
        def t_f_df(a):
            # type: (DataFrame) -> int
            assert_frame_equal(pandas_data_frame, a)
            return 1
github databand-ai / dbnd / modules / dbnd-airflow / test_dbnd_airflow / airflow_home / dag_spark_example / dag_with_spark.py View on Github external
@task
def t_A(p_str="check", p_int=2):
    # type: (str,int) -> str
    logging.info("I am running")
    return p_str * p_int
github databand-ai / dbnd / modules / dbnd / test_dbnd / task / test_task_decorator.py View on Github external
@task
def t_f_a(t_input, t_param, t_default="d1"):
    # type: (DataList[str], str, str) -> DataList[str]
    # adds dressing
    assert t_default == "d1"
    assert t_param == "d2"

    log_metric("t_input", len(t_input))

    logger.info("Got string: %s", t_input)
    return t_input[:2]
github databand-ai / dbnd / modules / dbnd / test_dbnd / task / test_task_inline_parsing.py View on Github external
@task
def inline_dict_of_dict(dfs):
    logging.info("Shape: %s", dfs["df_a"]["df_b"].shape)
    return dfs["df_a"]
github databand-ai / dbnd / modules / dbnd / test_dbnd / task / test_task_decorator.py View on Github external
        @task
        def t_f(t_input, t_int, t_time):
            # type: (DataList[str], int, datetime.datetime) -> List[str]
            return ["1"]
github databand-ai / dbnd / modules / dbnd / src / dbnd / _core / inplace_run / airflow_utils.py View on Github external
def track_python_operator(operator):
    if isinstance(operator.python_callable, _decorated_user_func):
        # function already has @task
        return

    operator.python_callable = task(operator.python_callable)
github databand-ai / dbnd / examples / src / dbnd_examples / features / dynamic_tasks.py View on Github external
@task
def join_greeting(base_greeting, extra_name):
    return "{} and {}".format(base_greeting, extra_name)