Skip to content

Commit

Permalink
Update docstring and annotation for Stream.get_records
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Apr 11, 2023
1 parent 0e2d2b6 commit 32fb526
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion singer_sdk/streams/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down

0 comments on commit 32fb526

Please sign in to comment.