File tree 1 file changed +9
-4
lines changed
Filter options
1 file changed +9
-4
lines changed
Original file line number Diff line number Diff line change @@ -548,10 +548,7 @@ def visit_bindparam(
548
548
bq_type = self .__remove_type_parameter (bq_type )
549
549
550
550
if bq_type == "JSON" :
551
- # FIXME: JSON is not a member of `SqlParameterScalarTypes` in the DBAPI
552
- # For now, we hack around this by:
553
- # - Rewriting the bindparam type to STRING
554
- # - Applying a bind expression that converts the parameter back to JSON
551
+
555
552
bq_type = "STRING"
556
553
557
554
assert_ (param != "%s" , f"Unexpected param: { param } " )
@@ -649,6 +646,14 @@ def visit_NUMERIC(self, type_, **kw):
649
646
visit_DECIMAL = visit_NUMERIC
650
647
651
648
def visit_JSON (self , type_ , ** kw ):
649
+ if isinstance (
650
+ kw .get ("type_expression" ), sqlalchemy .sql .expression .BindParameter
651
+ ): # bindparam
652
+ # FIXME: JSON is not a member of `SqlParameterScalarTypes` in the DBAPI
653
+ # For now, we hack around this by:
654
+ # - Rewriting the bindparam type to STRING
655
+ # - Applying a bind expression that converts the parameter back to JSON
656
+ return "STRING"
652
657
return "JSON"
653
658
654
659
You can’t perform that action at this time.
0 commit comments