What feature or improvement would you like to see?
I think it would make sense to document that the json/jsonb dtypes are returned as strings here https://arrow.apache.org/adbc/current/driver/postgresql.html, or at least update the Unknown Types section to mention that it's not always a binary that's returned
from adbc_driver_postgresql import dbapi
q = """SELECT
'{"foo": 1, "bar": "baz"}'::jsonb a,
'{"foo": 1, "bar": "baz"}'::json b
"""
def go():
with dbapi.connect("postgresql://scott:tiger@localhost:5432/scott") as conn:
with conn.cursor() as cur:
cur.execute(q)
row = cur.fetchone()
print(row, [type(col) for col in row])
t = cur.execute(q).fetch_arrow_table()
print(t)
go()
this prints
('{"bar": "baz", "foo": 1}', '{"foo": 1, "bar": "baz"}') [<class 'str'>, <class 'str'>]
pyarrow.Table
a: string
b: string
----
a: [["{"bar": "baz", "foo": 1}"]]
b: [["{"foo": 1, "bar": "baz"}"]]
What feature or improvement would you like to see?
I think it would make sense to document that the json/jsonb dtypes are returned as strings here https://arrow.apache.org/adbc/current/driver/postgresql.html, or at least update the Unknown Types section to mention that it's not always a binary that's returned
this prints