diff --git a/singer_sdk/sinks/core.py b/singer_sdk/sinks/core.py index c4cb6741d..4ccaa5d12 100644 --- a/singer_sdk/sinks/core.py +++ b/singer_sdk/sinks/core.py @@ -14,6 +14,7 @@ from types import MappingProxyType import fastjsonschema +from typing_extensions import override from singer_sdk.exceptions import ( InvalidJSONSchema, @@ -98,6 +99,7 @@ def __init__( error_message = f"Schema Validation Error: {e}" raise InvalidJSONSchema(error_message) from e + @override def validate(self, record: dict): # noqa: ANN201 """Validate a record message. diff --git a/tests/core/sinks/test_format_checker.py b/tests/core/sinks/test_format_checker.py index b546ba642..3f466dd55 100644 --- a/tests/core/sinks/test_format_checker.py +++ b/tests/core/sinks/test_format_checker.py @@ -43,9 +43,11 @@ def default_sink(target, test_schema): class CustomSink(Sink): """Custom sink class.""" + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass @@ -61,9 +63,11 @@ class CustomSink(Sink): validate_field_string_format = True + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass @@ -93,9 +97,11 @@ def get_validator(self) -> BaseJSONSchemaValidator | None: }, ) + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass diff --git a/tests/core/sinks/test_type_checker.py b/tests/core/sinks/test_type_checker.py index 16a1e67b7..72f736743 100644 --- a/tests/core/sinks/test_type_checker.py +++ b/tests/core/sinks/test_type_checker.py @@ -3,6 +3,7 @@ from __future__ import annotations import pytest +from typing_extensions import override from singer_sdk.sinks.core import BaseJSONSchemaValidator, InvalidJSONSchema, Sink from singer_sdk.target_base import Target @@ -36,9 +37,11 @@ def test_default_schema_type_checks(target, test_schema_invalid): class CustomSink(Sink): """Custom sink class.""" + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass @@ -55,6 +58,7 @@ def test_disable_schema_type_checks_returning_none(target, test_schema_invalid): class CustomSink(Sink): """Custom sink class.""" + @override def get_validator(self) -> BaseJSONSchemaValidator | None: """Get a record validator for this sink. @@ -66,9 +70,11 @@ def get_validator(self) -> BaseJSONSchemaValidator | None: """ return None + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass @@ -83,9 +89,11 @@ class CustomSink(Sink): validate_schema = False + @override def process_batch(self, context: dict) -> None: pass + @override def process_record(self, record: dict, context: dict) -> None: pass