VARBYTE is decoded into utf-8
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Run the supplied Python reproduction against Redshift and inspect the connector's VARBYTE result-decoding path when the final query executes. Confirm that VARBYTE values are returned as Python bytes without a UnicodeDecodeError, then add or update coverage for the demonstrated query behavior.
Written by the indexing model from the issue text.
Description
In readme VARBYTE is stated as supported as Python's bytes type. When trying to query data VARBYTE data from Redshift, 'utf-8' decoding error is thrown.
Reproduction
import redshift_connector
DROP_DDL = "drop table if exists varbyte_repro"
CREATE_DDL = """create table varbyte_repro(
my_var varbyte
);
"""
INSERT_DML = "insert into varbyte_repro(my_var) values (from_hex(SHA1('hello')))"
QUERY = "select * from varbyte_repro"
with redshift_connector.connect(
host="replaced",
database="replaced",
user="replaced",
password="replaced",
) as conn, conn.cursor() as cursor:
conn.autocommit = True
cursor.execute(DROP_DDL)
cursor.execute(CREATE_DDL)
cursor.execute(INSERT_DML)
cursor.execute(QUERY)
Expected
Last cursor.execute runs without issue (so that later something like cursor.fetchall could be used)
Actual
Error thrown:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xaa in position 0: invalid start byte
- Dominant language
- Python
- Stars
- 220
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/amazon-redshift-python-driver
-
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
aws/amazon-redshift-python-driver#268 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
aws/amazon-redshift-python-driver#265 · 1 comment · 4 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
aws/amazon-redshift-python-driver#260 · 5 comments · 2 reactions ·
All issues in aws/amazon-redshift-python-driver
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100