Skip to content

Commit 49573e8

Browse files
smtakedaankit-bhatnagar167
authored andcommitted
SNOW-75423: Fixed binding None in qmark mode
1 parent fd058fb commit 49573e8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
u'bytes': u'BINARY',
5050
u'bytearray': u'BINARY',
5151
u'bool': u'BOOLEAN',
52-
u'nonetype': None,
52+
u'nonetype': u'ANY',
5353
u'datetime': u'TIMESTAMP_NTZ',
5454
u'sfdatetime': u'TIMESTAMP_NTZ',
5555
u'date': u'DATE',

test/test_qmark.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,16 @@ def test_binding_datetime_qmark(conn_cnx, db_parameters):
138138
cnx.cursor().execute(
139139
"DROP TABLE IF EXISTS {name}".format(
140140
name=db_parameters['name']))
141+
142+
143+
def test_binding_none(conn_cnx):
144+
import snowflake.connector
145+
snowflake.connector.paramstyle = 'qmark'
146+
147+
with conn_cnx() as con:
148+
try:
149+
table_name = 'foo'
150+
con.cursor().execute('CREATE TABLE {table}(bar text)'.format(table=table_name))
151+
con.cursor().execute('INSERT INTO {table} VALUES (?)'.format(table=table_name), [None])
152+
finally:
153+
con.cursor().execute('DROP TABLE {table}'.format(table=table_name))

0 commit comments

Comments
 (0)