Query_api.query never ending

Hi, I’m new to influxdb.
Trying this tutorial I run into an eternally running query after the last line:

## import dependencies
import tensorflow as tf 
import numpy as np
import pandas as pd

## Loading the data as a pandas dataframe 
data = pd.read_csv("sunspots.csv", index_col=0) 
## show first dew rows of the dataset
data.head()

## import dependencies
from influxdb_client import InfluxDBClient, Point, WritePrecision
from influxdb_client.client.write_api import SYNCHRONOUS

## You can generate a Token from the "Tokens Tab" in the UI
token = "my-token"
org = "my-org"
bucket = "my-bucket"

## connect to influxdb 
client = InfluxDBClient(url = "http://localhost:8086", token = token, org = org)

# convert Date column to datetime 
data['Date'] = pd.to_datetime(data['Date'])

## create date as index
data.set_index(data['Date'], drop = True, inplace = True)
data.drop('Date', axis = 1, inplace = True)
data.head()

## create object of write API
write_api = client.write_api(write_options = SYNCHRONOUS)

## write data to influxdb
response = write_api.write(bucket, record = data, data_frame_measurement_name = 'sunspot',
                        data_frame_tag_columns = ['sunspot'])

## query data
query_api = client.query_api()
tables = query_api.query('from(bucket:"my-bucket") |> range(start: -275y)')

My CPU and memory usage is very high, but it never ends.

Hi @hr4dv9,
Welcome to the community :slight_smile: . I must admit I am a little lost, do you have data stemming back 275 years?
What is the goal here? Do you have any data returned to you or does your application just wait? :slight_smile:

Yes, it’s data starting form 1749: Time-Series-Forecasting-with-Tensorflow-and-InfluxDB/Sunspots.csv at master · gouravsinghbais/Time-Series-Forecasting-with-Tensorflow-and-InfluxDB · GitHub
But only one value per month, so it’s not too much (3236 values).

I expect the tables variable to be filled with data. The application is running and consuming a lot of cpu power and memory, but is never finished.

Awsome, thanks @hr4dv9. I will have a try on my end and get back to you.

Hi @hr4dv9,
So i managed to ingest your data into InfluxDB OSS with the following code:
Note its ALOT of data all at once. So what you will find InfluxDB OSS becomes unresponsive for a little bit while its compressing all the data to disk. This could be better handled with better batching settings but if its a one time upload then it shouldn’t matter to much.

Here is a link to the code: Sunspots/main.py at master · Jayclifford345/Sunspots · GitHub