This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
SELECT SUM(*)
does unwanted type cast #715
Closed
Description
Software versions
Influxdb version: 1.7.6
influxdb-python version: 5.2.2
Steps to reproduce:
- Create a measurement named
my_measurement
in influxdb with following points:
time data_type value
---------- ---------- -----
15578637... Num 12.5
15578637... Num 12.5
- Run the following code:
>>> from influxdb import InfluxDBClient
>>> c = InfluxDBClient(...)
>>> result_set = c.query('select * from my_measurement')
... for _, generator in result_set.items():
... for point in generator:
... print(type(point['value']))
<class 'float'>
<class 'float'>
>>> result_set = c.query('select sum(*) from my_measurement')
... for _, generator in result_set.items():
... for point in generator:
... print(type(point['sum_value']))
<class 'int'>
The casting into 'int' type is incorrect since we are summing floats, result should still be a float.
Metadata
Metadata
Assignees
Labels
No labels