Skip to content

Commit

Permalink
Revert "Low-Code CDK: make RecordFilter.filter_records as generator (#…
Browse files Browse the repository at this point in the history
…24772)"

This reverts commit 032f9b8.
  • Loading branch information
artem1205 committed Apr 19, 2023
1 parent 2cdde75 commit b571e4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@ def filter_records(
next_page_token: Optional[Mapping[str, Any]] = None,
) -> List[Record]:
kwargs = {"stream_state": stream_state, "stream_slice": stream_slice, "next_page_token": next_page_token}
for record in records:
if self._filter_interpolator.eval(self.config, record=record, **kwargs):
yield record
return [record for record in records if self._filter_interpolator.eval(self.config, record=record, **kwargs)]
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def test_record_filter(test_name, filter_template, records, expected_records):
actual_records = record_filter.filter_records(
records, stream_state=stream_state, stream_slice=stream_slice, next_page_token=next_page_token
)
assert list(actual_records) == expected_records
assert actual_records == expected_records
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_record_filter(test_name, field_path, filter_template, body, expected_re
actual_records = record_selector.select_records(
response=response, stream_state=stream_state, stream_slice=stream_slice, next_page_token=next_page_token
)
assert list(actual_records) == expected_records
assert actual_records == expected_records


def create_response(body):
Expand Down

0 comments on commit b571e4a

Please sign in to comment.