ProcessStackManager#

class etl_entities.process.process_stack_manager.ProcessStackManager(**kwargs)#

Handles current stack of processes

Deprecated since version 2.0.0.

default: ClassVar[Process] = Process(name='python', host='build-23649405-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)