-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
Driver version
2.0.876
Redshift version
Redshift 1.0.23412
Client Operating System
Mac OS 10.15.7
Python version
3.9.1
Table schema
bookname varchar
author varchar
Problem description
-
Expected behaviour:
When the table has columnsbookname
andauthor
, column names in cursor.description are also available asbookname
andauthor
. -
Actual behaviour:
What I got from cursor.description wereb'bookname'
andb'author\xe2\x80\x8e'
. -
Error message/stack trace:
No error message for this issue. -
Any other details that can be helpful:
See the reproduction code.
Python Driver trace logs
No trace for this issue.
Reproduction code
Code
# This is the same as the sample code on README
cursor: redshift_connector.Cursor = conn.cursor()
cursor.execute("create Temp table book(bookname varchar,author varchar)")
cursor.executemany("insert into book (bookname, author) values (%s, %s)",
[
('One Hundred Years of Solitude', 'Gabriel García Márquez'),
('A Brief History of Time', 'Stephen Hawking')
]
)
cursor.execute("select * from book")
result: tuple = cursor.fetchall()
print(result)
# This is the piece of code that I added:
for field in cursor.description:
print(field)
Output
(['A Brief History of Time', 'Stephen Hawking'], ['One Hundred Years of Solitude', 'Gabriel García Márquez'])
(b'bookname', 1043, None, None, None, None, None)
(b'author\xe2\x80\x8e', 1043, None, None, None, None, None)
Metadata
Metadata
Assignees
Labels
No labels