Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 9, 2024
1 parent ef3a073 commit 9969668
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pirogue/multiple_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,14 @@ def create(self) -> bool:
queries.append(self.__delete_trigger())
queries.append(self.__extras())

for sql in queries:
if not sql:
for _sql in queries:
if not _sql:
continue
try:
if self.variables:
self.cursor.execute(psycopg.sql.SQL(sql).format(self.variables))
else:
self.cursor.execute(sql)
except TypeError:
self.cursor.execute(psycopg.sql.SQL(_sql).format(**self.variables))
except (TypeError, KeyError):
success = False
print(f"*** Failing:\n{sql}\n***")
print(f"*** Failing:\n{_sql}\n***")
raise VariableError(
"An error in a SQL variable is probable. "
"Check the variables in the SQL code "
Expand All @@ -207,7 +204,7 @@ def create(self) -> bool:
)
)
except psycopg.Error as e:
print(f"*** Failing:\n{sql}\n***")
print(f"*** Failing:\n{_sql}\n***")
raise e
self.conn.commit()
self.conn.close()
Expand Down

0 comments on commit 9969668

Please sign in to comment.