Skip to content

Commit e80cd37

Browse files
Update src/questdb/mpdecimal_compat.pxd
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 989c4e0 commit e80cd37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/questdb/mpdecimal_compat.pxd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ cdef inline int decimal_pyobj_to_binary(
3030
unsigned char* unscaled,
3131
unsigned int* scale,
3232
object ingress_error_cls,
33-
object bad_dataframe_code) noexcept:
33+
object bad_dataframe_code) except -1:
3434
"""Convert a Python ``Decimal`` to ILP binary components."""
3535
cdef mpd_t* mpd
3636
cdef mpd_uint_t* digits_ptr
3737
cdef unsigned long long flag_low
3838
cdef uint32_t exp
39-
cdef Py_ssize_t out_size
39+
cdef size_t out_size
4040

4141
mpd = decimal_mpd(cell)
4242

@@ -59,9 +59,9 @@ cdef inline int decimal_pyobj_to_binary(
5959
f'Decimal scale {-mpd.exp} exceeds the maximum supported scale of 76')
6060
scale[0] = -mpd.exp
6161

62-
if not qdb_mpd_to_bigendian(digits_ptr, mpd.len, MPD_RADIX, exp, (flag_low & MPD_FLAG_SIGN) != 0, unscaled, <size_t *>&out_size):
62+
if not qdb_mpd_to_bigendian(digits_ptr, mpd.len, MPD_RADIX, exp, (flag_low & MPD_FLAG_SIGN) != 0, unscaled, &out_size):
6363
raise ingress_error_cls(
6464
bad_dataframe_code,
6565
'Decimal mantissa too large; maximum supported size is 32 bytes.')
6666

67-
return out_size
67+
return <int>out_size

0 commit comments

Comments
 (0)