ProcessStackManager#

class etl_entities.process.process_stack_manager.ProcessStackManager#

Handles current stack of processes

Methods

get_current()

Returns latest process in the stack or a default one

get_current_level()

Returns number of processes in the stack

pop()

Pops a process from the stack

push(process)

Pushes a process to the stack

default: ClassVar[Process] = Process(name='python', host='build-20711595-project-836176-etl-entities', dag='', task='')#

Default process returned by ProcessStackManager.get_current

classmethod get_current() Process#

Returns latest process in the stack or a default one

Examples

from etl_entities import ProcessStackManager, Process

with Process(name="mycolumn", host="myhost") as process:
    assert ProcessStackManager.get_current() == process

assert ProcessStackManager.get_current() == Process()  # some default process
classmethod get_current_level() int#

Returns number of processes in the stack

Returns:
resultint

Number of processes

Examples

from etl_entities import ProcessStackManager, Process

with Process(name="mycolumn", host="myhost"):
    assert ProcessStackManager.get_current_level() == 1

assert ProcessStackManager.get_current_level() == 0
classmethod pop() Process#

Pops a process from the stack

Returns:
processetl_entities.process.process.Process

Process instance. If stack is empty, IndexError will be raised

Examples

from etl_entities import ProcessStackManager

process = ProcessStackManager.pop(process)
classmethod push(process: Process) None#

Pushes a process to the stack

Parameters:
processetl_entities.process.process.Process

Process instance

Examples

from etl_entities import ProcessStackManager, Process

process = Process(name="mycolumn", host="myhost")
ProcessStackManager.push(process)