From af95cbc52c326bc925e185009ea5888f3a5869be Mon Sep 17 00:00:00 2001 From: jbirddog <100367399+jbirddog@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:49:53 -0500 Subject: [PATCH] process_new_vendor fix, part duex (#2) --- src/connector_postgres_v2/base_command.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/connector_postgres_v2/base_command.py b/src/connector_postgres_v2/base_command.py index deac35d..72395cf 100644 --- a/src/connector_postgres_v2/base_command.py +++ b/src/connector_postgres_v2/base_command.py @@ -65,17 +65,10 @@ def handler(conn: Any, cursor: Any) -> None: return self._execute(sql, conn_str, handler) def fetchall(self, sql: str, conn_str: str, values: list) -> ConnectorProxyResponseDict: - def prep_results(results: list) -> list: - # takes the raw results which is a list of a single item list of strings that - # look like tuples with embedded quotes: - # - [["(1,\"some vendor\")"], ["(2,\"another vendor\")"]] - # and turns it into a list of lists of strings that represent the data for each - # column. this way the individual values can be accessed directly from task data. - # - [["1", "some vender"], ["2", "another_vendor"]] - return [r[0][1:-1].replace('"', '').split(",") for r in results] def handler(conn: Any, cursor: Any) -> list: cursor.execute(sql, values) - return prep_results(cursor.fetchall()) + conn.commit() + return cursor.fetchall() return self._execute(sql, conn_str, handler)