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 - Fork524
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
Open
Description
- InfluxDB-python version: 5.3.1
- Python version: tried 3.6 and 3.8
- Operating system version: Windows 10
DataFrameClient.write_points
usingprotocol=json
currently only seem to embedtags
when alsotag_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 in7cb5656
ifnottag_columns: | |
points= [ | |
{'measurement':measurement, | |
'fields': | |
rec.replace([np.inf,-np.inf],np.nan).dropna().to_dict(), | |
'time':np.int64(ts.value/precision_factor)} | |
forts, (_,rec)inzip( | |
dataframe.index, | |
dataframe[field_columns].iterrows() | |
) | |
] | |
returnpoints | |
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)} | |
forts,tag, (_,rec)inzip( | |
dataframe.index, | |
dataframe[tag_columns].to_dict('record'), | |
dataframe[field_columns].iterrows() | |
) | |
] | |
returnpoints |
Please maketag_columns
also optional using json protocol.
Metadata
Metadata
Assignees
Labels
No labels