mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix new UP031 errors from ruff 0.4.2
This commit is contained in:
+3
-3
@@ -85,7 +85,7 @@ def printquery(statement, bind=None):
|
||||
"""
|
||||
if isinstance(value, str):
|
||||
value = value.replace("'", "''")
|
||||
return "'%s'" % value
|
||||
return f"'{value}'"
|
||||
elif value is None:
|
||||
return "NULL"
|
||||
elif isinstance(value, (float, int)):
|
||||
@@ -93,10 +93,10 @@ def printquery(statement, bind=None):
|
||||
elif isinstance(value, decimal.Decimal):
|
||||
return str(value)
|
||||
elif isinstance(value, datetime.datetime):
|
||||
return "TO_DATE('%s','YYYY-MM-DD HH24:MI:SS')" % value.strftime("%Y-%m-%d %H:%M:%S")
|
||||
return f"TO_DATE('{value.strftime('%Y-%m-%d %H:%M:%S')}','YYYY-MM-DD HH24:MI:SS')"
|
||||
|
||||
else:
|
||||
raise NotImplementedError("Don't know how to literal-quote value %r" % value)
|
||||
raise NotImplementedError(f"Don't know how to literal-quote value {value!r}")
|
||||
|
||||
compiler = LiteralCompiler(dialect, statement)
|
||||
print(compiler.process(statement))
|
||||
|
||||
Reference in New Issue
Block a user