Skip to content

Commit

Permalink
Refactor string formats to fstring
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz committed Nov 5, 2023
1 parent 908b2e1 commit 501d1eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DatabaseLibrary/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ def delete_all_rows_from_table(self, tableName, sansTran=False, alias=None):
"""
dbconnection, _ = self._cache.switch(alias)
cur = None
selectStatement = "DELETE FROM %s" % tableName
query = "DELETE FROM %s" % tableName
try:
cur = dbconnection.cursor()
logger.info("Executing : Delete All Rows From Table | %s " % selectStatement)
result = self.__execute_sql(cur, selectStatement)
logger.info(f"Executing : Delete All Rows From Table | {query}")
result = self.__execute_sql(cur, query)
if result is not None:
if not sansTran:
dbconnection.commit()
Expand Down Expand Up @@ -269,7 +269,7 @@ def execute_sql_script(self, sqlScriptFileName, sansTran=False, alias=None):
try:
statements_to_execute = []
cur = dbconnection.cursor()
logger.info("Executing : Execute SQL Script | %s " % sqlScriptFileName)
logger.info(f"Executing : Execute SQL Script | {sqlScriptFileName}")
current_statement = ""
inside_statements_group = False

Expand Down Expand Up @@ -351,7 +351,7 @@ def execute_sql_string(self, sqlString, sansTran=False, alias=None):
cur = None
try:
cur = dbconnection.cursor()
logger.info("Executing : Execute SQL String | %s " % sqlString)
logger.info(f"Executing : Execute SQL String | {sqlString}")
self.__execute_sql(cur, sqlString)
if not sansTran:
dbconnection.commit()
Expand Down Expand Up @@ -404,7 +404,7 @@ def call_stored_procedure(self, spName, spParams=None, sansTran=False, alias=Non
spParams = []
cur = None
try:
logger.info("Executing : Call Stored Procedure | %s | %s " % (spName, spParams))
logger.info(f"Executing : Call Stored Procedure | {spName} | {spName} ")
if db_api_module_name == "pymssql":
cur = dbconnection.cursor(as_dict=False)
else:
Expand Down

0 comments on commit 501d1eb

Please sign in to comment.