duckdb: [Python] Empty IOException upon installing JSON extension
What happens?
Upon installation of JSON extension in DuckDB an empty IOException with neither stack trace nor error message gets thrown, making it difficult to debug it further. Here is a simplest example of the failing code:
import duckdb
if __name__ == "__main__":
# sys.setdlopenflags(os.RTLD_GLOBAL | os.RTLD_NOW) # Running on Windows
con = duckdb.connect()
con.execute("INSTALL 'json';")
The process also fails when attempting installation from file:
import duckdb
if __name__ == "__main__":
# File lies in CWD
duckdb.install_extension("json.duckdb_extension")
In both cases, all the error information returned is:
Traceback (most recent call last):
File "c:\dev\projects\openai\debug.py", line 10, in <module>
con.execute("INSTALL 'json';")
duckdb.IOException
It does not look to me like a problem finding the installation file not a syntax error in my SQL query. Otherwise the DB seems to function properly; I am able to connect, create a test table, insert data and fetch it via the fetchdf method. I am using release 0.7.1 but I got the same error with the 0.7.0, 0.6.1 and 0.7.2.dev1256 versions.
To Reproduce
- Create a
pipenvenvironment from the followingPipenvfile:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
duckdb = "*"
[dev-packages]
[requires]
python_version = "3.10"
- run the following code snippet:
import duckdb
if __name__ == "__main__":
con = duckdb.connect()
con.execute("INSTALL 'json';")
OS:
Windows 10
DuckDB Version:
0.7.1
DuckDB Client:
Python
Full Name:
Daniel Moseguí i González
Affiliation:
paiqo GmbH
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
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 15 (3 by maintainers)
I couldn’t quite reproduce your problem, but this code does show (I think, assuming that there should be a “colon: message” after the ParserException) that DuckDB exceptions get truncated under certain conditions:
Note the truncated ParserException message.
---- Edit: #6573 gave me an idea, and this also is closer to the error, but I can’t reproduce the error on “install ‘json’” —