Skip to content

Commit

Permalink
refactor(taps): Use CursorResult.mappings() in SQL streams (#2095)
Browse files Browse the repository at this point in the history
* refactor(taps): Use `CursorResult.mappings()` in SQL streams

* Avoid segmentation fault in SQLAlchemy 1.4???

* Remove redundant `.all()`
  • Loading branch information
edgarrmondragon authored Dec 8, 2023
1 parent 93ed07a commit a99eb9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions singer_sdk/streams/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]:
query = query.limit(self.ABORT_AT_RECORD_COUNT + 1)

with self.connector._connect() as conn:
for record in conn.execute(query):
transformed_record = self.post_process(dict(record._mapping))
for record in conn.execute(query).mappings():
# TODO: Standardize record mapping type
# https://github.com/meltano/sdk/issues/2096
transformed_record = self.post_process(dict(record))
if transformed_record is None:
# Record filtered out during post_process()
continue
Expand Down

0 comments on commit a99eb9f

Please sign in to comment.