Skip to content

Commit

Permalink
Revert "refactor: Deprecate row parameter of Stream.post_process
Browse files Browse the repository at this point in the history
…in favor or `record`"

This reverts commit c8f38fc.
  • Loading branch information
edgarrmondragon committed Jul 18, 2024
1 parent c8f38fc commit c3bad13
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repos:
- id: check-readthedocs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.3
rev: v0.5.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ unfixable = [
"SLF001",
"PLC2701", # Allow usage of private members in tests
"PLR6301", # Don't suggest making test methods static, etc.
"INP001", # flake8-no-pep420: implicit-namespace-package
]
# Disabled some checks in samples code
"samples/*" = ["ANN", "D"]
Expand Down
21 changes: 0 additions & 21 deletions singer_sdk/helpers/_deprecation.py

This file was deleted.

21 changes: 3 additions & 18 deletions singer_sdk/streams/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import datetime
import json
import typing as t
from contextlib import contextmanager
from os import PathLike
from pathlib import Path
from types import MappingProxyType
Expand All @@ -29,7 +28,6 @@
)
from singer_sdk.helpers._catalog import pop_deselected_record_properties
from singer_sdk.helpers._compat import datetime_fromisoformat
from singer_sdk.helpers._deprecation import deprecate_row_param
from singer_sdk.helpers._flattening import get_flattening_options
from singer_sdk.helpers._state import (
finalize_state_progress_markers,
Expand Down Expand Up @@ -1157,15 +1155,6 @@ def _sync_batches(
self._write_batch_message(encoding=encoding, manifest=manifest)
self._write_state_message()

@contextmanager
def _with_context(
self,
context: types.Context | None,
) -> t.Generator[None, None, None]:
self.context = MappingProxyType(context) if context else None
yield
self.context = None

# Public methods ("final", not recommended to be overridden)

@t.final
Expand Down Expand Up @@ -1398,10 +1387,9 @@ def get_batches(
for manifest in batcher.get_batches(records=records):
yield batch_config.encoding, manifest

@deprecate_row_param
def post_process( # noqa: PLR6301
self,
record: types.Record,
row: types.Record,
context: types.Context | None = None, # noqa: ARG002
) -> dict | None:
"""As needed, append or transform raw data to match expected structure.
Expand All @@ -1415,13 +1403,10 @@ def post_process( # noqa: PLR6301
invalid or not-applicable records from the stream.
Args:
record: Individual record in the stream.
row: Individual record in the stream.
context: Stream partition or context dictionary.
Returns:
The resulting record dict, or `None` if the record should be excluded.
.. versionchanged:: 0.39.0
The ``row`` parameter was renamed to ``record`` with a deprecation warning.
"""
return record
return row
2 changes: 1 addition & 1 deletion singer_sdk/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ class Property(JSONTypeHelper[T], t.Generic[T]):
"""Generic Property. Should be nested within a `PropertiesList`."""

# TODO: Make some of these arguments keyword-only. This is a breaking change.
def __init__(
def __init__( # noqa: PLR0913
self,
name: str,
wrapped: JSONTypeHelper[T] | type[JSONTypeHelper[T]],
Expand Down
70 changes: 0 additions & 70 deletions tests/core/helpers/test_deprecation.py

This file was deleted.

0 comments on commit c3bad13

Please sign in to comment.