Hooks global state#

skip_all_hooks()

Temporary stop all onETL hooks.

stop_all_hooks()

Stop all hooks for all classes.

resume_all_hooks()

Resume all onETL hooks.

onetl.hooks.hooks_state.skip_all_hooks()#

Temporary stop all onETL hooks. Designed to be used as context manager or decorator.

Note

If hooks were stopped by stop_all_hooks, they will not be resumed after exiting the context/decorated function. You should call resume_all_hooks explicitly.

Examples

from onetl.hooks import skip_all_hooks

# hooks are enabled

with skip_all_hooks():
    # hooks are stopped here
    ...

# hook state is restored
onetl.hooks.hooks_state.stop_all_hooks() None#

Stop all hooks for all classes.

Examples

from onetl.hooks import stop_all_hooks

# hooks are executed

stop_all_hooks()

# all hooks are stopped now
onetl.hooks.hooks_state.resume_all_hooks() None#

Resume all onETL hooks.

Note

This function does not enable hooks which were disabled by onetl.hooks.hook.Hook.disable, or stopped by onetl.hooks.support_hooks.suspend_hooks.

Examples

from onetl.hooks import resume_all_hooks, stop_all_hooks

stop_all_hooks()

# hooks are stopped

resume_all_hooks()

# all hooks are executed now