Skip to content

Commit

Permalink
fix padding
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Nov 29, 2023
1 parent b6ae4f2 commit b3b1d5c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions py/sqlutilpy/sqlutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,13 @@ def __print_arrays(arrays, f, delimiter=' '):
if i != 0:
f.write(delimiter.encode())
if fmts[i] is None:
curstr = np.array2string(row[field],
threshold=None,
separator=',')
curstr = np.array2string(
row[field],
threshold=None,
separator=',',
formatter={'all': lambda x: str(x)})
# formatter is needed because otherwise there is
# whitespace padding
curstr = '{' + curstr[1:-1] + '}'
f.write(curstr.encode())
else:
Expand Down

0 comments on commit b3b1d5c

Please sign in to comment.