diff --git a/docs/changelog/next_release/71.breaking.rst b/docs/changelog/next_release/71.breaking.rst new file mode 100644 index 0000000..5cf32b0 --- /dev/null +++ b/docs/changelog/next_release/71.breaking.rst @@ -0,0 +1 @@ +Remove ``cover`` method from base ``HWM`` class, it only remains in ``FileHWM`` class diff --git a/etl_entities/VERSION b/etl_entities/VERSION index ac2cdeb..ccbccc3 100644 --- a/etl_entities/VERSION +++ b/etl_entities/VERSION @@ -1 +1 @@ -2.1.3 +2.2.0 diff --git a/etl_entities/hwm/file/file_hwm.py b/etl_entities/hwm/file/file_hwm.py index 55e27ad..c840e41 100644 --- a/etl_entities/hwm/file/file_hwm.py +++ b/etl_entities/hwm/file/file_hwm.py @@ -15,6 +15,7 @@ from __future__ import annotations import os +from abc import abstractmethod from typing import Generic, Optional, TypeVar from pydantic import Field, validator @@ -67,6 +68,10 @@ class FileHWM( class Config: # noqa: WPS431 json_encoders = {AbsolutePath: os.fspath} + @abstractmethod + def covers(self, value: FileHWMValueType) -> bool: + """Return ``True`` if input value is already covered by HWM""" + def __eq__(self, other): """Checks equality of two FileHWM instances diff --git a/etl_entities/hwm/key_value/key_value_int_hwm.py b/etl_entities/hwm/key_value/key_value_int_hwm.py index ae20a95..b93bf28 100644 --- a/etl_entities/hwm/key_value/key_value_int_hwm.py +++ b/etl_entities/hwm/key_value/key_value_int_hwm.py @@ -69,6 +69,8 @@ class KeyValueIntHWM(KeyValueHWM[int]): ) """ + # employing frozendict without specifying `frozendict[Any, int]` + # due to the lack of support for generic dict annotations in Python 3.7. value: frozendict = Field(default_factory=frozendict) def serialize(self) -> dict: