Hooks global state#
Temporary stop all onETL hooks. |
|
Stop all hooks for all classes. |
|
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 callresume_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
from onetl.hooks import skip_all_hooks # hooks are enabled @skip_all_hooks() def main(): # hooks are stopped here ... main()
- 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 byonetl.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