diff --git a/CHANGELOG.md b/CHANGELOG.md index 0689f63..4a1bfa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ Types of changes: ## [Unreleased] +## [0.11.1] - 2026-01-22 + ### Fixed - Ensure all check classes accept and forward `identifier_placeholder` so naming-only identifier filters use the configured placeholder for result naming and logging. Add unit tests covering the behavior. diff --git a/pyproject.toml b/pyproject.toml index 0485fbd..f78684e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "koality" -version = "0.11.0" +version = "0.11.1" authors = [ { name = "Team PiT @ Otto Group data.works GmbH" }, { name = "Norbert Maager" }, diff --git a/src/koality/checks.py b/src/koality/checks.py index 326bda8..aef16ac 100644 --- a/src/koality/checks.py +++ b/src/koality/checks.py @@ -811,7 +811,6 @@ def __init__( *, filters: dict[str, Any] | None = None, identifier_format: str = "identifier", - identifier_placeholder: str = "ALL", date_info: str | None = None, extra_info: str | None = None, monitor_only: bool = False, @@ -841,7 +840,6 @@ def __init__( upper_threshold=upper_threshold, filters=filters, identifier_format=identifier_format, - identifier_placeholder=identifier_placeholder, date_info=date_info, extra_info=extra_info, monitor_only=monitor_only, @@ -1027,7 +1025,6 @@ def __init__( *, filters: dict[str, Any] | None = None, identifier_format: str = "identifier", - identifier_placeholder: str = "ALL", date_info: str | None = None, extra_info: str | None = None, monitor_only: bool = False, @@ -1043,7 +1040,6 @@ def __init__( upper_threshold=upper_threshold, filters=filters, identifier_format=identifier_format, - identifier_placeholder=identifier_placeholder, date_info=date_info, extra_info=extra_info, monitor_only=monitor_only, @@ -1071,7 +1067,6 @@ def __init__( *, filters: dict[str, Any] | None = None, identifier_format: str = "identifier", - identifier_placeholder: str = "ALL", date_info: str | None = None, extra_info: str | None = None, monitor_only: bool = False, @@ -1087,7 +1082,6 @@ def __init__( upper_threshold=upper_threshold, filters=filters, identifier_format=identifier_format, - identifier_placeholder=identifier_placeholder, date_info=date_info, extra_info=extra_info, monitor_only=monitor_only, @@ -1115,7 +1109,6 @@ def __init__( *, filters: dict[str, Any] | None = None, identifier_format: str = "identifier", - identifier_placeholder: str = "ALL", date_info: str | None = None, extra_info: str | None = None, monitor_only: bool = False, @@ -1131,7 +1124,6 @@ def __init__( upper_threshold=upper_threshold, filters=filters, identifier_format=identifier_format, - identifier_placeholder=identifier_placeholder, date_info=date_info, extra_info=extra_info, monitor_only=monitor_only, @@ -1183,7 +1175,6 @@ def __init__( *, filters: dict[str, Any] | None = None, identifier_format: str = "identifier", - identifier_placeholder: str = "ALL", date_info: str | None = None, extra_info: str | None = None, monitor_only: bool = False, @@ -1203,7 +1194,6 @@ def __init__( upper_threshold=upper_threshold, filters=filters, identifier_format=identifier_format, - identifier_placeholder=identifier_placeholder, date_info=date_info, extra_info=extra_info, monitor_only=monitor_only, diff --git a/tests/unit/test_identifier_placeholder_checks.py b/tests/unit/test_identifier_placeholder_checks.py deleted file mode 100644 index 67bfe33..0000000 --- a/tests/unit/test_identifier_placeholder_checks.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Unit tests ensuring identifier_placeholder is respected by checks.""" - -import datetime as dt - -import pytest - -from koality.checks import ( - AverageCheck, - MaxCheck, - MinCheck, - OccurrenceCheck, - RollingValuesInSetCheck, -) - -pytestmark = pytest.mark.unit - - -def test_average_check_uses_identifier_placeholder() -> None: - """AverageCheck uses identifier_placeholder for naming-only identifier filters.""" - chk = AverageCheck( - database_accessor="", - database_provider=None, - table="t", - check_column="col", - filters={"shop_id": {"type": "identifier"}}, - identifier_format="filter_name", - identifier_placeholder="PH", - ) - assert chk.identifier == "PH" - assert chk.identifier_column == "SHOP_ID" - - -def test_max_check_uses_identifier_placeholder() -> None: - """MaxCheck uses identifier_placeholder for naming-only identifier filters.""" - chk = MaxCheck( - database_accessor="", - database_provider=None, - table="t", - check_column="col", - filters={"shop_id": {"type": "identifier"}}, - identifier_format="filter_name", - identifier_placeholder="PH2", - ) - assert chk.identifier == "PH2" - assert chk.identifier_column == "SHOP_ID" - - -def test_min_check_uses_identifier_placeholder() -> None: - """MinCheck uses identifier_placeholder for naming-only identifier filters.""" - chk = MinCheck( - database_accessor="", - database_provider=None, - table="t", - check_column="col", - filters={"shop_id": {"type": "identifier"}}, - identifier_format="filter_name", - identifier_placeholder="PH3", - ) - assert chk.identifier == "PH3" - assert chk.identifier_column == "SHOP_ID" - - -def test_occurrence_check_uses_identifier_placeholder() -> None: - """OccurrenceCheck uses identifier_placeholder for naming-only identifier filters.""" - chk = OccurrenceCheck( - database_accessor="", - database_provider=None, - max_or_min="max", - table="t", - check_column="col", - filters={"shop_id": {"type": "identifier"}}, - identifier_format="filter_name", - identifier_placeholder="PH4", - ) - assert chk.identifier == "PH4" - assert chk.identifier_column == "SHOP_ID" - - -def test_rolling_values_in_set_check_requires_date_and_uses_placeholder() -> None: - """RollingValuesInSetCheck requires a date filter and uses identifier_placeholder.""" - # Provide a date filter to satisfy constructor requirements - today = dt.datetime.now(tz=dt.UTC).date().isoformat() - chk = RollingValuesInSetCheck( - database_accessor="", - database_provider=None, - table="t", - check_column="col", - value_set=["a"], - filters={ - "partition_date": {"column": "DATE", "value": today, "type": "date"}, - "shop_id": {"type": "identifier"}, - }, - identifier_format="filter_name", - identifier_placeholder="PH5", - ) - assert chk.identifier == "PH5" - assert chk.identifier_column == "SHOP_ID" diff --git a/uv.lock b/uv.lock index 953ffcc..c566134 100644 --- a/uv.lock +++ b/uv.lock @@ -332,7 +332,7 @@ wheels = [ [[package]] name = "koality" -version = "0.11.0" +version = "0.11.1" source = { editable = "." } dependencies = [ { name = "click" },