summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/json.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/json.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/json.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/json.py b/lib/sqlalchemy/dialects/mysql/json.py
index 534fb989d..162d48f73 100644
--- a/lib/sqlalchemy/dialects/mysql/json.py
+++ b/lib/sqlalchemy/dialects/mysql/json.py
@@ -58,7 +58,6 @@ class _FormatTypeMixin(object):
class JSONIndexType(_FormatTypeMixin, sqltypes.JSON.JSONIndexType):
-
def _format_value(self, value):
if isinstance(value, int):
value = "$[%s]" % value
@@ -70,8 +69,10 @@ class JSONIndexType(_FormatTypeMixin, sqltypes.JSON.JSONIndexType):
class JSONPathType(_FormatTypeMixin, sqltypes.JSON.JSONPathType):
def _format_value(self, value):
return "$%s" % (
- "".join([
- "[%s]" % elem if isinstance(elem, int)
- else '."%s"' % elem for elem in value
- ])
+ "".join(
+ [
+ "[%s]" % elem if isinstance(elem, int) else '."%s"' % elem
+ for elem in value
+ ]
+ )
)