This repository was archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 522
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
Tags in write_points: tag_columns not optional when using json protocol #910
Copy link
Copy link
Open
Description
- InfluxDB-python version: 5.3.1
- Python version: tried 3.6 and 3.8
- Operating system version: Windows 10
DataFrameClient.write_points using protocol=json currently only seem to embed tags when also tag_columns are specified. This is not what you would want, and also not as stated in the docs.
influxdb-python/influxdb/_dataframe_client.py
Lines 286 to 313 in 7cb5656
| if not tag_columns: | |
| points = [ | |
| {'measurement': measurement, | |
| 'fields': | |
| rec.replace([np.inf, -np.inf], np.nan).dropna().to_dict(), | |
| 'time': np.int64(ts.value / precision_factor)} | |
| for ts, (_, rec) in zip( | |
| dataframe.index, | |
| dataframe[field_columns].iterrows() | |
| ) | |
| ] | |
| return points | |
| points = [ | |
| {'measurement': measurement, | |
| 'tags': dict(list(tag.items()) + list(tags.items())), | |
| 'fields': | |
| rec.replace([np.inf, -np.inf], np.nan).dropna().to_dict(), | |
| 'time': np.int64(ts.value / precision_factor)} | |
| for ts, tag, (_, rec) in zip( | |
| dataframe.index, | |
| dataframe[tag_columns].to_dict('record'), | |
| dataframe[field_columns].iterrows() | |
| ) | |
| ] | |
| return points |
Please make tag_columns also optional using json protocol.
Metadata
Metadata
Assignees
Labels
No labels