questdb / py-questdb-client

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

Wrong data entry(date issue - shows year as 1970) #46

Closed mighty-phoenix closed 11 months ago

mighty-phoenix commented 11 months ago

Describe the bug

While pushing data to questdb using ILP(questdb client in python), I'm passing the correct datetime data for my designated timestamp, but it shows up wrongly(shows date as 1970-01-20T13:49:27.971713Z even though I'm passing current time). I've tried many different ways of passing the date data to questdb, and the issue persists. Please help me out. Thanks!

To reproduce

  1. Create any table in questdb
  2. Insert data using python
    sender.row(
            'table_name',
            columns={
                'date': TimestampMicros.now()},
            at=TimestampNanos.now())
  3. See data on web console.

Expected Behavior

Correct timestamp should show up.

Environment

- **QuestDB version**: 7.2
- **OS**: Amazon Linux 2
- **Browser**: Chrome
amunra commented 11 months ago

Hi, sorry I didn't get around to responding yet.

Did you get things working?

May I presume, since you're closing the issue, that it was something on your end?

If it was down to some API confusion, is there anything we can improve from the documentation side of things?

Thanks!

mighty-phoenix commented 11 months ago

Hey @amunra Yes it was a problem at my end... Actually I didn't know that the at= parameter in the Sender functions was for setting the designated timestamp... I was passing it as column data. Was able to figure it out because of your slack community. Thanks!😁

amunra commented 11 months ago

I'm glad you managed to sort it out. It's a bit of a historical quirk that the designated timestamp is nanos rather than micros.

We don't have enough info in the client to prevent this type of error, sorry.

I'm glad you figured it out and thank you for sharing your feedback!