From ed536a8e5d11d11944ab0f819df2b60d5cc68b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Rami=CC=81rez=20Mondrago=CC=81n?= Date: Sat, 23 Jul 2022 15:30:19 -0500 Subject: [PATCH] fix: Fix typo RecordsWitoutSchemaException -> RecordsWithoutSchemaException --- ...r_sdk.exceptions.RecordsWithoutSchemaException.rst | 7 +++++++ docs/reference.rst | 2 +- singer_sdk/exceptions.py | 2 +- singer_sdk/target_base.py | 11 ++++++----- 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 docs/classes/singer_sdk.exceptions.RecordsWithoutSchemaException.rst diff --git a/docs/classes/singer_sdk.exceptions.RecordsWithoutSchemaException.rst b/docs/classes/singer_sdk.exceptions.RecordsWithoutSchemaException.rst new file mode 100644 index 000000000..210513146 --- /dev/null +++ b/docs/classes/singer_sdk.exceptions.RecordsWithoutSchemaException.rst @@ -0,0 +1,7 @@ +singer_sdk.exceptions.RecordsWithoutSchemaException +================================================== + +.. currentmodule:: singer_sdk.exceptions + +.. autoclass:: RecordsWithoutSchemaException + :members: diff --git a/docs/reference.rst b/docs/reference.rst index f4c517268..f0fd0915b 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -76,7 +76,7 @@ Exception Types exceptions.InvalidStreamSortException exceptions.MapExpressionError exceptions.MaxRecordsLimitException - exceptions.RecordsWitoutSchemaException + exceptions.RecordsWithoutSchemaException exceptions.RetriableAPIError exceptions.StreamMapConfigError exceptions.TapStreamConnectionFailure diff --git a/singer_sdk/exceptions.py b/singer_sdk/exceptions.py index eddc7af52..dd3674675 100644 --- a/singer_sdk/exceptions.py +++ b/singer_sdk/exceptions.py @@ -22,7 +22,7 @@ class MaxRecordsLimitException(Exception): """Exception to raise if the maximum number of allowable records is exceeded.""" -class RecordsWitoutSchemaException(Exception): +class RecordsWithoutSchemaException(Exception): """Raised if a target receives RECORD messages prior to a SCHEMA message.""" diff --git a/singer_sdk/target_base.py b/singer_sdk/target_base.py index dad17f09c..1b58e88d6 100644 --- a/singer_sdk/target_base.py +++ b/singer_sdk/target_base.py @@ -13,7 +13,7 @@ from joblib import Parallel, delayed, parallel_backend from singer_sdk.cli import common_options -from singer_sdk.exceptions import RecordsWitoutSchemaException +from singer_sdk.exceptions import RecordsWithoutSchemaException from singer_sdk.helpers._classproperty import classproperty from singer_sdk.helpers._compat import final from singer_sdk.helpers.capabilities import CapabilitiesEnum, PluginCapabilities @@ -135,7 +135,7 @@ def get_sink( sink depending on the values within the `record` object. Otherwise, please see `default_sink_class` property and/or the `get_sink_class()` method. - Raises :class:`singer_sdk.exceptions.RecordsWitoutSchemaException` if sink does + Raises :class:`singer_sdk.exceptions.RecordsWithoutSchemaException` if sink does not exist and schema is not sent. Args: @@ -233,16 +233,17 @@ def add_sink( return result def _assert_sink_exists(self, stream_name: str) -> None: - """Raise a RecordsWitoutSchemaException exception if stream doesn't exist. + """Raise a RecordsWithoutSchemaException exception if stream doesn't exist. Args: stream_name: TODO Raises: - RecordsWitoutSchemaException: If sink does not exist and schema is not sent. + RecordsWithoutSchemaException: If sink does not exist and schema + is not sent. """ if not self.sink_exists(stream_name): - raise RecordsWitoutSchemaException( + raise RecordsWithoutSchemaException( f"A record for stream '{stream_name}' was encountered before a " "corresponding schema." )