Skip to content

Commit

Permalink
Merge pull request #1 from matleg/patch-fix-example
Browse files Browse the repository at this point in the history
fix: write 2 points in example.py
  • Loading branch information
matleg authored Dec 5, 2024
2 parents ab16384 + 170e6ff commit c250e8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# write using point structure
write_api.write(bucket="my-bucket", record=p)

line_protocol = p.to_line_protocol()
plp = Point("my_measurement").tag("location", "Athens").field("temperature", 35.3) \
.time(datetime.now(tz=timezone.utc))
line_protocol = plp.to_line_protocol()
print(line_protocol)

# write using line protocol string
Expand Down

0 comments on commit c250e8e

Please sign in to comment.