Skip to content

Commit 0e2bbc0

Browse files
authored
Update bulk_insert.py (#22)
1 parent 9461dec commit 0e2bbc0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bulk_insert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,22 @@ def prop_to_binary(prop_val, type):
296296
return struct.pack(format_str, Type.NULL)
297297

298298
# If field can be cast to a float, allow it
299-
if type == None or type == Type.NUMERIC:
299+
if type is None or type == Type.NUMERIC:
300300
try:
301301
numeric_prop = float(prop_val)
302302
if not math.isnan(numeric_prop) and not math.isinf(numeric_prop): # Don't accept non-finite values.
303303
return struct.pack(format_str + "d", Type.NUMERIC, numeric_prop)
304304
except:
305305
pass
306306

307-
if type == None or type == Type.BOOL:
307+
if type is None or type == Type.BOOL:
308308
# If field is 'false' or 'true', it is a boolean
309309
if prop_val.lower() == 'false':
310310
return struct.pack(format_str + '?', Type.BOOL, False)
311311
elif prop_val.lower() == 'true':
312312
return struct.pack(format_str + '?', Type.BOOL, True)
313313

314-
if type == None or type == Type.STRING:
314+
if type is None or type == Type.STRING:
315315
# If we've reached this point, the property is a string
316316
encoded_str = str.encode(prop_val) # struct.pack requires bytes objects as arguments
317317
# Encoding len+1 adds a null terminator to the string

0 commit comments

Comments
 (0)