duckdb icon indicating copy to clipboard operation
duckdb copied to clipboard

TIME Value result -> Pandas Dataframe does not return datetime.time

Open Tishj opened this issue 3 years ago • 0 comments

What happens?

When the result is of type TIME, exporting this result to a dataframe converts the value to a string, instead of an object of type datetime.time

time = duckdb.query("SELECT make_time(23, 1, 34.234345) AS '0'").df()
----
'23:01:34.234345'

Whereas exporting it as a tuple through fetchone() does create the expected result:

time = duckdb.query("SELECT make_time(23, 1, 34.234345) AS '0'").fetchone()
----
(datetime.time(23, 1, 34, 234345),)

Environment (please complete the following information):

  • OS: (e.g. iOS)
  • DuckDB Version: [master:latest]
  • DuckDB Client: [Python]

Identity Disclosure:

  • Full Name: [Thijs Bruineman]
  • Affiliation: [DuckDBLabs]

Before Submitting

  • [x] Have you tried this on the latest master branch?
  • Python: pip install duckdb --upgrade --pre
  • R: install.packages("https://github.com/duckdb/duckdb/releases/download/master-builds/duckdb_r_src.tar.gz", repos = NULL)
  • Other Platforms: You can find binaries here or compile from source.
  • [x] Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

Tishj avatar Jul 04 '22 11:07 Tishj