Skip to content

TIMESTAMP field with infinity value breaks DuckDBPyRelation fetchall() method. #8143

@cpklein

Description

@cpklein

What happens?

When trying to extract the Relation content via fetchall, I get the following error:

>>> flist.fetchall()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
duckdb.ConversionException: Conversion Error: Date out of range in timestamp conversion

To Reproduce

Run the following Python code on console

import duckdb
con = duckdb.connect(':default:')
con.execute("""CREATE TABLE fset(
    filename VARCHAR,
    path VARCHAR[],
    origin VARCHAR,
    tags VARCHAR[],
    created TIMESTAMP,
    removed TIMESTAMP,
    hidden BOOLEAN,
    processed BOOLEAN,
    owner VARCHAR,
    changed_by VARCHAR,
    read_user VARCHAR[],
    read_group VARCHAR[],
    change_user VARCHAR[],
    change_group VARCHAR[])"""
)
con.execute("INSERT INTO fset SELECT * FROM read_json('file01.json', auto_detect=true, union_by_name=true)")
flist = con.sql("select * from fset")
con.sql("select removed from flist")
flist.fetchall()

file01.json

[
	{
		"filename" : "file0001.json",
		"path" : ["json"],
		"origin" : ["json"],
		"tags" : [ "tag01", "tag02" ],
		"created" : "2023-06-28 15:26:53.51-03",
		"removed" : "infinity",
		"hidden" : false,
		"processed" : true,
		"owner" : "user0001",
		"changed_by" : "user0001",
		"read_user" : ["user0001"],
		"read_group" : ["group0001"],
		"change_user" : ["user0001"],
		"change_group" : ["group0001"]
	}
]

OS:

osx

DuckDB Version:

duckdb==0.8.1

DuckDB Client:

Python

Full Name:

Caio Klein

Affiliation:

SkyOne

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions