Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing to the database fails silently when writing tuple with no Exception raised and no effect on the database #150

Closed
lukas-ba-github opened this issue Sep 10, 2020 · 2 comments · Fixed by #152
Milestone

Comments

@lukas-ba-github
Copy link

lukas-ba-github commented Sep 10, 2020

I spent a bit of time wondering why influxdb does not contain my data or why there is no error raised by influxdb-client-python so please consider this bug report.

Steps to reproduce:

import datetime
from influxdb_client import InfluxDBClient, Point, WritePrecision
from influxdb_client.client.write_api import SYNCHRONOUS

dT = datetime.datetime.utcnow()

org = "testOrg"
url = "http://localhost:8086"
token = '-'
bucket = "testBucket"

p = (
    Point("testM")
    .time(dT, write_precision=WritePrecision.S)
    .tag("testT", "abc")
    .field("testF", 1)
)
client = InfluxDBClient(url=url, token=token, org=org)
write_api = client.write_api(write_options=SYNCHRONOUS)
# fails silently, no error raised even if the database does not exist
record = (p, )
write_api.write(bucket, org, record)

# works
#record = [p, ]
#write_api.write(bucket, org, record)

Expected behavior:
Option A:

  • a point is inserted into the database
  • Tuples and other iterables are accepted instead of Lists to be more pythonic

Option B:

  • only Lists are accepted
  • a ValueError is raised for Tuples

Actual behavior:
Nothing happens

Specifications:

  • Client Version: influxdb-client 1.10.0
  • InfluxDB Version: influxdb 1.8.2-1
  • Platform: Linux, Arch Linux
@bednar
Copy link
Contributor

bednar commented Sep 11, 2020

Hi @lukas-ba-github,

thanks for using our client.

It is a nice catch. The option A seems to be a better solution so we will fix it as you suggested.

Regards

@bednar bednar added this to the 1.11.0 milestone Sep 11, 2020
@bednar
Copy link
Contributor

bednar commented Sep 11, 2020

Hi @lukas-ba-github,

The issue is fixed in 1.11.0 milestone.

If you would like to use a dev version then install client via:

pip install git+https://github.com/influxdata/influxdb-client-python.git@master

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants