Skip to content

Commit 0098765

Browse files
committed
add support for double and other edge cases
1 parent 3f7fe4f commit 0098765

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.generator/src/generator/formatter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,22 +383,22 @@ def format_data_with_schema(
383383
else:
384384

385385
def format_number(x):
386-
if isinstance(x, bool):
386+
if isinstance(x, bool | str):
387387
raise TypeError(f"{x} is not supported type {schema}")
388388
return str(x)
389389

390390
def format_double(x):
391-
if isinstance(x, bool):
391+
if isinstance(x, bool | str):
392392
raise TypeError(f"{x} is not supported type {schema}")
393393
return float(x)
394394

395395
def format_int(x):
396-
if isinstance(x, str):
396+
if isinstance(x, bool | str):
397397
raise TypeError(f"{x} is not supported type {schema}")
398398
return str(x)
399399

400400
def format_int64(x):
401-
if isinstance(x, str):
401+
if isinstance(x, bool | str):
402402
raise TypeError(f"{x} is not supported type {schema}")
403403
return str(x) + "L"
404404

0 commit comments

Comments
 (0)