Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: breaking rename changes: row->record (BREAKS) #966

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream)
for record in resp_json.get("<TODO>"):
yield record

def post_process(self, row: dict, context: Optional[dict] = None) -> dict:
def post_process(self, record: dict, context: Optional[dict] = None) -> dict:
"""As needed, append or transform raw data to match expected structure."""
# TODO: Delete this method if not needed.
return row
return record
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream)
# TODO: Parse response body and return a set of records.
yield from extract_jsonpath(self.records_jsonpath, input=response.json())

def post_process(self, row: dict, context: Optional[dict]) -> dict:
def post_process(self, record: dict, context: Optional[dict]) -> dict:
"""As needed, append or transform raw data to match expected structure."""
# TODO: Delete this method if not needed.
return row
return record
6 changes: 3 additions & 3 deletions singer_sdk/streams/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ def get_records(self, context: dict | None) -> Iterable[dict | tuple[dict, dict]
"""
pass

def post_process(self, row: dict, context: dict | None = None) -> dict | None:
def post_process(self, record: dict, context: dict | None = None) -> dict | None:
"""As needed, append or transform raw data to match expected structure.

Optional. This method gives developers an opportunity to "clean up" the results
Expand All @@ -1173,10 +1173,10 @@ def post_process(self, row: dict, context: dict | None = None) -> dict | None:
invalid or not-applicable records from the stream.

Args:
row: Individual record in the stream.
record: Individual record in the stream.
context: Stream partition or context dictionary.

Returns:
The resulting record dict, or `None` if the record should be excluded.
"""
return row
return record