Skip to main content

dag_generator.dags.tdag

TDag Objects

class TDag(DAG)

The Airflow DAG extension

:raises Exception, FileNotFoundError:

Arguments:

  • dag_dir: The path to the directory with the dag file (or its YAML)
  • factory: The type of factory to generate, if 'None', then the dag was created without generating
  • kwargs: Additional arguments

get_result

def get_result(operator: TBaseOperator, result_name: str, result_type: str, work_type: str, work_conn_id: str = None, **kwargs, ,) -> BaseResult

Return result. No physical initialization is taking place

Raises:

  • ValueError:

Returns:

The result of the operator

get_work

def get_work(work_type: str = None, work_conn_id: str = None) -> BaseWork

Get work by conn_id. Note! Only the class itself is created here, work is not initialized and is not created

Raises:

  • ValueError:

Returns:

Work with work_type located in work_conn_id

clear_all_works

def clear_all_works(context: dict)

Clearing all works after execution

get_all_works

def get_all_works(context: dict)

Clearing all work on completion of execution

get_callable_by_def

def get_callable_by_def(func_def: str) -> Callable

Get a function by its description from yaml. Lambdas are supported. If the function is in the project, use it directly. If the function is in code.py - take it from there, otherwise from the global

Arguments:

  • func_def: Function description

Returns:

Callable