Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Filtering by tags results in empty list #506

Closed
mhlg opened this issue Sep 23, 2017 · 1 comment · Fixed by #511
Closed

Filtering by tags results in empty list #506

mhlg opened this issue Sep 23, 2017 · 1 comment · Fixed by #511

Comments

@mhlg
Copy link

mhlg commented Sep 23, 2017

I'm observing an unexpected issue while reading data from InfluxDB

client = InfluxDBClient('localhost', 8086, 'root', 'root', 'influx_demo')

result = client.query("SELECT * FROM energy WHERE time >= '2015-01-01T00:00:00Z' AND time <= '2015-01-01T00:30:00Z'")

series = list(result.get_points(tags={'source': 'SBERA0'}))

series variable is an empty list and it should not; the same query using CLI returns the following points where [account location source] are "Tags" and value is "Field"

> SELECT * FROM energy WHERE time >= '2015-01-01T00:00:00Z' AND time <= '2015-01-01T00:30:00Z'
name: energy
time                account location source value
----                ------- -------- ------ -----
1420070400000000000 BER     A        SBERA0 1
1420070400000000000 PAR     A        SPARA0 3
1420070400000000000 LOS     A        SLOSA0 6
1420070400000000000 LON     A        SLONA0 4
1420070400000000000 MIL     A        SMILA0 4
1420070700000000000 LON     A        SLONA0 6
1420070700000000000 MIL     A        SMILA0 8
[...]

I can make it work by using GROUP BY clause

result = client.query("SELECT * FROM energy WHERE time >= '2015-01-01T00:00:00Z' AND time <= '2015-01-01T00:30:00Z' GROUP BY source")

series = list(result.get_points(tags={'source': 'SBERA0'}))

But at this point I can only use the tag you have used in GROUP BY tags={'source': }
and using multiple tags tags={'source': , 'location': } is not returning appropriate values.

@xginn8
Copy link
Collaborator

xginn8 commented Oct 3, 2017

closing as a dupe of #251 and #441

@xginn8 xginn8 closed this as completed Oct 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants