From 32fb526ce37ce2aed11ee7457115b0eff63d0669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Rami=CC=81rez=20Mondrago=CC=81n?= Date: Tue, 11 Apr 2023 16:10:24 -0600 Subject: [PATCH] Update docstring and annotation for `Stream.get_records` --- singer_sdk/streams/core.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/singer_sdk/streams/core.py b/singer_sdk/streams/core.py index 83e7d86c6..101ff7ef6 100644 --- a/singer_sdk/streams/core.py +++ b/singer_sdk/streams/core.py @@ -1287,7 +1287,10 @@ def get_child_context(self, record: dict, context: dict | None) -> dict | None: # Abstract Methods @abc.abstractmethod - def get_records(self, context: dict | None) -> Iterable[dict | tuple[dict, dict]]: + def get_records( + self, + context: dict | None, + ) -> Iterable[dict | tuple[dict, dict | None]]: """Abstract record generator function. Must be overridden by the child class. Each record emitted should be a dictionary of property names to their values. @@ -1306,6 +1309,11 @@ def get_records(self, context: dict | None) -> Iterable[dict | tuple[dict, dict] Parent streams can optionally return a tuple, in which case the second item in the tuple being a `child_context` dictionary for the stream's `context`. + + If the child context object in the tuple is ``None``, the child streams will + be skipped. This is useful for cases where the parent record was deleted and + the child records can no longer be synced. + More info: :doc:`/parent_streams` Args: