Skip to content

Commit

Permalink
[DOP-22128] Fix docstring for KeyValueIntHWM
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 27, 2025
1 parent ef22f9d commit a546284
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
4 changes: 2 additions & 2 deletions etl_entities/hwm/key_value/key_value_hwm.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class KeyValueHWM(HWM[frozendict], Generic[KeyValueHWMKeyType, KeyValueHWMValueT
Description of HWM
source : Any, default: ``None``
entity : Any, default: ``None``
HWM source, e.g. ``topic`` name
HWM entity, e.g. ``topic`` name
expression : Any, default: ``None``
Expand Down
4 changes: 2 additions & 2 deletions etl_entities/hwm/key_value/key_value_int_hwm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class KeyValueIntHWM(KeyValueHWM[int, int]):
Description of HWM
source : Any, default: ``None``
entity : Any, default: ``None``
HWM source, e.g. topic name
HWM entity, e.g. topic name
expression : Any, default: ``None``
Expand Down
39 changes: 39 additions & 0 deletions tests/test_hwm_store/test_hwm_store_get_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ColumnIntHWM,
FileListHWM,
FileModifiedTimeHWM,
KeyValueIntHWM,
)
from etl_entities.hwm_store import MemoryHWMStore

Expand Down Expand Up @@ -60,6 +61,36 @@ def file_with_mtime(mtime: datetime) -> Path:
),
datetime(2025, 1, 1, 22, 33, 44, 567890),
),
(
KeyValueIntHWM(
name=f"{secrets.token_hex(5)}.{secrets.token_hex(5)}",
# no topic
expression="offset",
value={
0: 100,
1: 123,
},
),
{
0: 110,
1: 150,
},
),
(
KeyValueIntHWM(
name=f"{secrets.token_hex(5)}.{secrets.token_hex(5)}",
topic="topic_name",
expression="offset",
value={
0: 100,
1: 123,
},
),
{
0: 110,
1: 150,
},
),
(
FileListHWM(
name=secrets.token_hex(5),
Expand All @@ -76,6 +107,14 @@ def file_with_mtime(mtime: datetime) -> Path:
),
"/absolute/path/file3",
),
(
FileModifiedTimeHWM(
name=secrets.token_hex(5),
# no directory
value=datetime(2025, 1, 1, 11, 22, 33, 456789, tzinfo=timezone.utc),
),
file_with_mtime(datetime(2025, 1, 1, 22, 33, 44, 567890, tzinfo=timezone.utc)),
),
(
FileModifiedTimeHWM(
name=secrets.token_hex(5),
Expand Down

0 comments on commit a546284

Please sign in to comment.