Skip to content

Commit a3e0c51

Browse files
committed
Add tags' names and values for "group by" queries
In queries like select count(value) from measuremente where ... group by * InfluxDB doesn't set "columns" but the tag names and values are provided by the "tags" raw data. If tags' dictionary is not empty it uses it as the initial dictionary, so it preserves the key-values but they will be overriden by columns names... if they exists (not seen yet).
1 parent 8a7f517 commit a3e0c51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

influxdb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
]
1414

1515

16-
__version__ = '2.8.0a'
16+
__version__ = '2.8.0b'

influxdb/resultset.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def get_points(self, measurement=None, tags=None):
107107
for point in serie.get('values', []):
108108
yield self.point_from_cols_vals(
109109
serie['columns'],
110-
point
110+
point,
111+
serie_tags
111112
)
112113

113114
def __repr__(self):
@@ -171,14 +172,14 @@ def items(self):
171172
return items
172173

173174
@staticmethod
174-
def point_from_cols_vals(cols, vals):
175+
def point_from_cols_vals(cols, vals, tags = None):
175176
""" Creates a dict from columns and values lists
176177
177178
:param cols: List of columns
178179
:param vals: List of values
179180
:return: Dict where keys are columns.
180181
"""
181-
point = {}
182+
point = tags or {}
182183
for col_index, col_name in enumerate(cols):
183184
point[col_name] = vals[col_index]
184185
return point

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy