sfu-db/connector-x

PanicException: called `Result::unwrap()` Error { kind: ConfigParse, cause: Some("unexpected EOF") }

amarshall-deckers opened this issue · 2 comments

What language are you using?

Python (3.7.7): sys.version_info(major=3, minor=7, micro=7, releaselevel='final', serial=0)

What version are you using?

connectorx 0.3.1

What database are you using?

Redshift

What dataframe are you using?

Arrow

Can you describe your bug?

I am getting an error when trying to run queries

What are the steps to reproduce the behavior?

Setup redshift test db/cluster. Using python 3.7.7 and connectorx as specified above, try running the python code shown

Database setup if the error only happens on specific data or data type

Table schema and example data

Example query / code
rs  = 'postgresql+psycopg2://<username><password"@<db_url>:<port>/<db>'
cx.read_sql(rs,"SELECT * FROM information_schema LIMIT 5")

What is the error?


PanicException Traceback (most recent call last)
in
----> 1 cx.read_sql(rs,"SELECT * FROM information_schema LIMIT 5")

~/.local/lib/python3.7/site-packages/connectorx/init.py in read_sql(conn, query, return_type, protocol, partition_on, partition_range, partition_num, index_col)
227 queries=queries,
228 protocol=protocol,
--> 229 partition_query=partition_query,
230 )
231 df = reconstruct_pandas(result)

PanicException: called Result::unwrap() on an Err value: Error { kind: ConfigParse, cause: Some("unexpected EOF") }

I needed to use redshift:// instead of psycopg2+postgresql://