File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,6 +392,16 @@ def format_double(x):
392392 raise TypeError (f"{ x } is not supported type { schema } " )
393393 return float (x )
394394
395+ def format_int (x ):
396+ if isinstance (x , str ):
397+ raise TypeError (f"{ x } is not supported type { schema } " )
398+ return str (x )
399+
400+ def format_int64 (x ):
401+ if isinstance (x , str ):
402+ raise TypeError (f"{ x } is not supported type { schema } " )
403+ return str (x ) + "L"
404+
395405 def format_string (x ):
396406 if isinstance (x , bool ):
397407 raise TypeError (f"{ x } is not supported type { schema } " )
@@ -425,8 +435,8 @@ def open_file(x):
425435 return f"new File({ format_string (x )} )"
426436
427437 formatters = {
428- "int32" : lambda x : str ( int ( x )) ,
429- "int64" : lambda x : str ( int ( x )) + "L" ,
438+ "int32" : format_int ,
439+ "int64" : format_int64 ,
430440 "double" : format_double ,
431441 "date-time" : format_datetime ,
432442 "number" : format_number ,
You can’t perform that action at this time.
0 commit comments