Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
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

@eduisterwinkel

Description

@eduisterwinkel
  • 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.

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions