influxdata / influxdata/influxdb-client-python

Different query result to DataExplorer

Open
#598 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
793
Forks
186
Avg merge
3h 2m
Merged PRs (30d)
1

Description

* Client Version: 1.37.0
* InfluxDB Version: v2.7.1
* Platform: Windows10

Query:
```python
from(bucket:"rust")
|> range(start: 2023-07-28T04:22:00Z, stop: 2023-07-28T04:25:00Z)
|> filter(fn: (r) => r["_measurement"] == "market_snapshot")
|> filter(fn: (r) => r["ticker"] == "TEST1" or r["ticker"] == "TEST2")
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|> keep(columns: ["_time", "ticker", "bid", "bidq", "ask", "askq", "volume"])
|> group()
```

Expected Behavior:
Query results are sorted based on _time

Actual behavior:
Query results are stacked based on ticker (tag)

result table _time ticker ask askq bid bidq volume
0 _result 0 2023-07-28 04:22:00.027463+00:00 TEST1 34275.0 9693 34265.0 696 0
1 _result 0 2023-07-28 04:22:00.229166+00:00 TEST1 34270.0 246 34265.0 696 0
2 _result 0 2023-07-28 04:22:00.370787+00:00 TEST1 34270.0 246 34265.0 1007 0
3 _result 0 2023-07-28 04:22:01.023661+00:00 TEST1 34270.0 247 34265.0 1007 0
4 _result 0 2023-07-28 04:22:01.083292+00:00 TEST1 34270.0 247 34265.0 1007 20
.. ... ... ... ... ... ... ... ... ...
809 _result 0 2023-07-28 04:24:56.852404+00:00 TEST2 34320.0 10122 34300.0 4355 0
810 _result 0 2023-07-28 04:24:57.046504+00:00 TEST2 34315.0 34 34300.0 4355 0
811 _result 0 2023-07-28 04:24:59.049960+00:00 TEST2 34315.0 72 34300.0 4355 0
812 _result 0 2023-07-28 04:24:59.405875+00:00 TEST2 34315.0 34 34300.0 4355 0
813 _result 0 2023-07-28 04:24:59.882963+00:00 TEST2 34315.0 9784 34300.0 100 0

After sorting

0 _result 0 2023-07-28 04:22:00.027463+00:00 TEST1 34275.0 9693 34265.0 696 0
1 _result 0 2023-07-28 04:22:00.229166+00:00 TEST1 34270.0 246 34265.0 696 0
2 _result 0 2023-07-28 04:22:00.370787+00:00 TEST1 34270.0 246 34265.0 1007 0
552 _result 0 2023-07-28 04:22:00.378335+00:00 TEST2 34320.0 10065 34300.0 4058 0
553 _result 0 2023-07-28 04:22:00.431953+00:00 TEST2 34320.0 10065 34300.0 4058 39
.. ... ... ... ... ... ... ... ... ...
549 _result 0 2023-07-28 04:24:59.393780+00:00 TEST1 34270.0 1148 34260.0 2108 1
550 _result 0 2023-07-28 04:24:59.399117+00:00 TEST1 34270.0 1962 34260.0 1307 0
812 _result 0 2023-07-28 04:24:59.405875+00:00 TEST2 34315.0 34 34300.0 4355 0
551 _result 0 2023-07-28 04:24:59.875531+00:00 TEST1 34270.0 9126 34260.0 825 0
813 _result 0 2023-07-28 04:24:59.882963+00:00 TEST2 34315.0 9784 34300.0 100 0

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Python client query against InfluxDB v2.7.1 using the supplied bucket, time range, measurement, and ticker filters. Compare the returned rows with the shown sorted output; done means results for TEST1 and TEST2 are ordered by _time rather than stacked by ticker.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.