Title
#users-public
Wyatt Miller

Wyatt Miller

08/15/2022, 4:19 PM
Hello everyone. I’ve noticed something very strange with Python ILP inserts and I was hoping someone could offer an explanation for me. I made a table that had a column ‘balance’ which held doubles. When I inserted the data through ILP the number changed upon insert! I inserted: 1849011808.238645 and when it is inserted through ILP it comes out as 1849011840.0- a very different number. When it is inserted through PG it works.
Alex Pelagenko

Alex Pelagenko

08/15/2022, 5:15 PM
did you use Python ILP QuestDB client?
Emmett

Emmett

08/15/2022, 6:49 PM
Hi @Alex Pelagenko yes we are using the python ILP client
Bolek Ziobrowski

Bolek Ziobrowski

08/16/2022, 9:16 AM
Hi @Wyatt Miller @Emmett . I reproduced on local and saw that changed number was sent by client . Seems like there's a double->float conversion happening inside the client . Could you please create issue in https://github.com/questdb/py-questdb-client ?
Adam Cimarosti

Adam Cimarosti

08/16/2022, 9:55 AM
cdef inline int _column_f64(
            self, line_sender_column_name c_name, float value) except -1:
                                              #   ^____ typo: This should be `double` instead of `float`.
        cdef line_sender_error* err = NULL
        if not line_sender_buffer_column_f64(self._impl, c_name, value, &err):
            raise c_err_to_py(err)
        return 0
9:57 AM
bint line_sender_buffer_column_f64(line_sender_buffer *buffer,
                                     line_sender_column_name name,
                                     double value,                        <--- the method it calls is correct, at least :-)
                                     line_sender_error **err_out)
9:58 AM
Found the bug, will fix in the next release. ETA: 1~2days at the most.
9:58 AM
Thanks for the report!
Wyatt Miller

Wyatt Miller

08/16/2022, 2:56 PM
Of course. Thank you guys!
Adam Cimarosti

Adam Cimarosti

08/16/2022, 9:36 PM
Fix is now released as
v1.0.1
. See the announcement for details: https://questdb.slack.com/archives/C1NFJEER0/p1660685671429519