Thanks to visit codestin.com
Credit goes to github.com

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

Resultset try42 [WIP] #151

Closed

Conversation

gst
Copy link
Contributor

@gst gst commented Apr 7, 2015

I create a PR with this unfinished work because there are certain things we must decide..

  1. Returning a ResultSet from InfluxDbClient.query() is great.

  2. Enabling to get the full list of resulting series from a resultset by doing list(resultset) is also great. But we have to clearly define the format of what's returned in the list actually..

  3. Enabling to get the full list (eventually filtered by serie name and/or tags values) of resulting points from a resultset using resultset[key] is also great. Here the Points are more well defined within influxdb.point now.

to be continued..

Grégory Starck added 6 commits April 7, 2015 10:01
+ if a serie is the result of a "system" query: it has no name attribute.
+ a serie can also have no associated tags.
1) cli.query() which now returns a ResultSet, which must be list()ed in order to obtain the list of series.
2) assertListEqual instead of assertDictEqual for a list result.

TODO: but now we have to fix the results format.
Other solution is to return the ResultSet instance but then we must adapt all call sites..

To be decided..
@@ -91,14 +91,14 @@ def __len__(self):
def keys(self):
keys = []
for serie in self._get_series():
keys.append((serie['name'], serie['tags']))
keys.append((serie.get('name', None), serie.get('tags', None)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which cases would name not be present? Same question for tags? Is it spec'd that no tags returns an empty list from the InfluxDB API: in which case that missing key should raise an exception instead of returning confusing data (None, None), wouldn't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"system" queries do not return a "name" , and "normal" queries (no "group by tag_name1(, tag_name2, ..)") doesn't return tags either.

NB: it's quite work in progress here ;)

Grégory Starck and others added 2 commits April 8, 2015 10:30
@aviau
Copy link
Collaborator

aviau commented Apr 8, 2015

I'll open a new PR with all the ResultSet code.

@aviau aviau closed this Apr 8, 2015
@aviau
Copy link
Collaborator

aviau commented Apr 8, 2015

see #154

@aviau aviau deleted the resultset_try42 branch April 9, 2015 16:34
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 this pull request may close these issues.

3 participants