In-memory HWM Store (ephemeral)#
- class etl_entities.hwm_store.memory_hwm_store.MemoryHWMStore#
In-memory local store for HWM values.
Note
This class should be used in tests only, because all saved HWM values will be deleted after exiting the context
Examples
Methods
clear
()Clears all stored HWM values.
get_hwm
(name)Get HWM by name from HWM store.
set_hwm
(hwm)Save HWM object to HWM Store.
- __enter__()#
HWM store context manager.
Enter this context to use this HWM store instance as current one (instead default).
Examples
with hwm_store: db_reader.run()
- clear() None #
Clears all stored HWM values.
- get_hwm(name: str) HWM | None #
Get HWM by name from HWM store.
- Parameters:
- namestr
HWM unique name
- Returns:
- HWM object, if it exists in HWM store, or None
Examples
from etl_entities.hwm import ColumnIntHWM real_hwm = hwm_store.get_hwm(hwm_unique_name)
- set_hwm(hwm: HWM) None #
Save HWM object to HWM Store.
- Parameters:
- hwm
etl_entities.hwm.HWM
HWM object
- hwm
- Returns:
- HWM location, like URL of file path.
Examples
from etl_entities.hwm import ColumnIntHWM hwm = ColumnIntHWM(name=..., value=...) hwm_location = hwm_store.set_hwm(hwm)