question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

trino-python-client returns dtype string for datetime/timestamp fields

See original GitHub issue

presto-client returns data type of string for a timestamp field. Setup:

  • PrestoSQL 333
  • PostgreSQL 12.1
  • presto-client 0.300.0

Tested:

  1. Using the PrestoSQL JDBC driver, the field is returned as a Java timestamp.
  2. Using psycopg2 driver with SQLalchemy directly to Postgres, the field is returned as a python datetime object or pandas timestamp object.
  3. Using presto-client 0.300, the field is returned as a string.

Expectation:
The field should be returned as a python datetime object or pandas timestamp object, akin to the PostgreSQL driver.

Note:
The issue has also been reported for pyhive (no longer under current development). I have not tested PrestoDB’s version to see if the other team has also worked on the topic.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mdesmetcommented, Apr 8, 2022

I think this issue can be closed as we merged #160.

1reaction
alexbrisancommented, Jun 7, 2021

I will take a look at the oracle one and come up with a plan!

Read more comments on GitHub >

github_iconTop Results From Across the Web

trino-python-client returns dtype string for datetime/timestamp ...
Using psycopg2 driver with SQLalchemy directly to Postgres, the field is returned as a python datetime object or pandas timestamp object. Using presto-client ......
Read more >
Converting between datetime, Timestamp and datetime64
It returns long because for numpy.datetime64 type .astype(datetime) is equivalent to .astype(object) that returns Python integer ( long ) on numpy-1.8 .
Read more >
How to convert a timestamp to string in pandas?
This convert the stamps datetime column to a string with format dd/mm/yyyy – note that after formatting with strftime, the Series / column...
Read more >
Time series / date functionality — pandas 1.5.2 documentation
If you pass a single string to to_datetime , it returns a single Timestamp . Timestamp can also accept string input, but it...
Read more >
Saving memory with Pandas 1.3's new string dtype
Series , and every column in a pandas.DataFrame , have a dtype: the type of object stored inside it. By default, Pandas will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found