Skip to content

bucket stays empty after sending dataframe. #651

@shyney7

Description

@shyney7

After sending the pandas dataframe like in the examples I only see the measurement name 'gpslive2' without any fields.
It seems that no data is being send besides the name.

This is the code I'm using

import pandas as pd
from datetime import datetime, timedelta
from influxdb_client import InfluxDBClient, WriteOptions

df = pd.read_csv(r'./gpslive/gpstobfilt.csv')

start_time = datetime(2024, 4, 14, 15)
df['time'] = [(start_time + timedelta(seconds=i)).timestamp() for i in range(len(df))]
df = df.set_index('time')

client = InfluxDBClient.from_config_file(r'./gpslive/config.ini')


with client as _client:
    with _client.write_api(write_options=WriteOptions(
        batch_size=500,
        flush_interval=10_000,
        jitter_interval=2_000,
        retry_interval=5_000,
        max_retries=5,
        max_retry_delay=30_000,
        max_close_wait= 300_000,
        exponential_base=2
    
    )) as _write_client:
        _write_client.write("gpslivetest", "roboflex", record=df, data_frame_measurement_name='gpslive2')

This is my dataframe:

               latitude  longitude    altitude  total_counts
time
1.713100e+09  51.402865   6.903985  466.414490          0.95
1.713100e+09  51.410175   6.906332  467.008087          1.75
1.713100e+09  51.415283   6.918162  471.229858          3.60
...

InfluxDB v2.7.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions