leaf_engine_flows.task

Attributes

logger

Classes

DatabaseReadTask

A thin wrapper around LeafTask to add database specific functionality.

LeafTask

A thin wrapper around Prefect's Task class.

MappedDashboardTask

A thin wrapper around LeafTask to add dashboard specific functionality.

MappedDatabaseReadTask

A mixin class of DatabaseReadTask and MappedDashboardTask.

Module Contents

class leaf_engine_flows.task.DatabaseReadTask(function: Callable, read_cached_db_calls: bool = False, *args, **kwargs)

Bases: LeafTask

A thin wrapper around LeafTask to add database specific functionality.

Parameters:
  • function (Callable) –

  • read_cached_db_calls (bool) –

enable_read_cached_db_calls()

Enables reading cached DB calls for the task.

target = None
class leaf_engine_flows.task.LeafTask(function: Callable, read_checkpoint: bool = False, write_checkpoint: bool = False, serializer: prefect.engine.serializers.Serializer = None, file_type: str = 'csv', *args, **kwargs)

Bases: prefect.Task

A thin wrapper around Prefect’s Task class.

Parameters:
  • function (Callable) – The function to execute when the task is run.

  • read_checkpoint (bool) –

  • write_checkpoint (bool) –

  • serializer (prefect.engine.serializers.Serializer) –

  • file_type (str) –

enable_read_checkpoint()

Enables reading a checkpoint file for the task.

enable_write_checkpoint()

Enables writing a checkpoint file for the task.

run(**kwargs) Any
Return type:

Any

checkpoint = False
file_type
function
location
name
result = None
serializer
target = None
class leaf_engine_flows.task.MappedDashboardTask(function: Callable, *args, **kwargs)

Bases: LeafTask

A thin wrapper around LeafTask to add dashboard specific functionality.

Will try to use a shipper-specific function if it exists, otherwise defers to the default function.

Parameters:

function (Callable) –

run(**kwargs) Any
Return type:

Any

serializer
class leaf_engine_flows.task.MappedDatabaseReadTask(function: Callable, read_cached_db_calls: bool = False, *args, **kwargs)

Bases: DatabaseReadTask, MappedDashboardTask

A mixin class of DatabaseReadTask and MappedDashboardTask.

Parameters:
  • function (Callable) –

  • read_cached_db_calls (bool) –

init(*args, **kwargs)
leaf_engine_flows.task.logger