Skip to content

Commit

Permalink
Add some @overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 4, 2023
1 parent 6dbfba2 commit 19f66ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions singer_sdk/sinks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from types import MappingProxyType

import fastjsonschema
from typing_extensions import override

from singer_sdk.exceptions import (
InvalidJSONSchema,
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions tests/core/sinks/test_format_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions tests/core/sinks/test_type_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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.
Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 19f66ed

Please sign in to comment.