questdb / py-questdb-client

Python client for QuestDB InfluxDB Line Protocol
https://py-questdb-client.readthedocs.io
Apache License 2.0
55 stars 10 forks source link

Non Timeseries Data #45

Closed chandler150 closed 1 year ago

chandler150 commented 1 year ago

Is there a way to send a pandas dataframe with no time column?

My use case would be to pull existing time series, run calcs on them, and then reupload kpis back to questdb This would save me from maintaining a SQL database.

I see questdb handles it natively by importing a test.csv with their web portal's csv import function.

amunra commented 1 year ago

You have a few options here.

The Python client always creates timeseries tables (ie, with a designated timestamp).

The simplest is to upload the data from the pandas table via the client library and ignore the the fact that you'll end up getting an extra column added.

A cleaner alternative is to create a non-timeseries table via SQL, convert the pandas dataframe to CSV and then upload it via the REST API: https://questdb.io/docs/guides/importing-data-rest/

PS. I'll close this issue, but feel free to reopen it if you have follow-up questions.

chandler150 commented 1 year ago

Thanks! Will test and let you know.