psqlpy
psqlpy copied to clipboard
psqlpy.exceptions.RustToPyValueMappingError: array contains too many dimensions
trafficstars
psqlpy-0.7.6
The following code raises: psqlpy.exceptions.RustToPyValueMappingError: Can't convert value from driver to python type: Cannot convert PostgreSQL type _int4 into Python type, err: array contains too many dimensions
(the query executes properly in PSQL)
import asyncio
from psqlpy import ConnectionPool
def main():
db_pool = ConnectionPool()
result = asyncio.run(db_pool.execute(
"SELECT array_agg(arr) FROM (SELECT array(SELECT generate_series(0, 10, 1)) as arr FROM (SELECT generate_series(0, 10, 1) as value));",
))
result.result()
db_pool.close()
main()
Hello! Thank you for your issue. I've found out that there is really a bug, and I'll fix it as soon as possible.
Thank you!
@nicolaspi Hello! I've made a new release https://github.com/psqlpy-python/psqlpy/releases/tag/0.7.7 with support for multi-dimensional arrays. Please check it out)