From 898455f23cd5feddf84a4c69667ff36f9d2a73bf Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sat, 2 Jan 2021 05:35:49 -0600 Subject: [PATCH] bug fix: sql writer::apply --- transport/sql.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/sql.py b/transport/sql.py index 69f3fcb..9f07730 100644 --- a/transport/sql.py +++ b/transport/sql.py @@ -60,12 +60,12 @@ class SQLRW : """ cursor = self.conn.cursor() try: - if "insert" in _sql .lower() or "update" in _sql.lower() : - # Executing a command i.e no expected return values ... - cursor.execute(_sql) - else: + if "select" in _sql.lower() : cursor.close() return pd.read_sql(_sql,self.conn) + else: + # Executing a command i.e no expected return values ... + cursor.execute(_sql) finally: cursor.close()