Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres _varchar can panic on Option.unwrap #489

Closed
auyer opened this issue Apr 18, 2023 · 0 comments · Fixed by #490
Closed

Postgres _varchar can panic on Option.unwrap #489

auyer opened this issue Apr 18, 2023 · 0 comments · Fixed by #490
Labels
bug Something isn't working

Comments

@auyer
Copy link
Contributor

auyer commented Apr 18, 2023

What language are you using?

Python

What version are you using?

0.3.2a4

What database are you using?

PostgreSQL

What dataframe are you using?

Arrow

Can you describe your bug?

Reading a varchar array can return error thread '<unnamed>' panicked at 'called Option::unwrap()on aNone value'
I was not able to figure out what row in my database led to this error because its a large base, and my PR fixes the issue already. But it would be interesting to figure this out and add it as a test condition.

What are the steps to reproduce the behavior?

If possible, please include a minimal simple example including:

Database setup if the error only happens on specific data or data type
CREATE TABLE mytable (
	id varchar(36) NOT NULL,
	arraycolumn _varchar NULL DEFAULT '{}'::character varying[],
);
Example query / code
SELECT  arraycolumn FROM mytable

What is the error?

RUST_BACKTRACE=full python main.py
[11:03:25] {/home/auyer/.local/lib/python3.10/site-packages/botocore/credentials.py:1255} INFO - Found credentials in shared credentials file: ~/.aws/credentials
[11:03:25] {/home/auyer/work/coding/datachapter-elts/python-container/polars-extraction/main.py:142} INFO - READING DATASET FROM DATABASE FROM TABLE orders
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /__w/connector-x/connector-x/connectorx/src/destinations/arrow2/arrow_assoc.rs:451:21
...
Traceback (most recent call last):
  File "/home/auyer/work/coding/datachapter-elts/python-container/polars-extraction/main.py", line 319, in <module>
    main()
  File "/home/auyer/work/coding/datachapter-elts/python-container/polars-extraction/main.py", line 299, in main
    overwriteMode(conn)
  File "/home/auyer/work/coding/datachapter-elts/python-container/polars-extraction/main.py", line 143, in overwriteMode
    df = read_sql(query, conn).lazy()
  File "/home/auyer/work/coding/datachapter-elts/python-container/polars-extraction/main.py", line 111, in read_sql
    df = cx.read_sql(
  File "/home/auyer/.local/lib/python3.10/site-packages/connectorx/__init__.py", line 297, in read_sql
    result = _read_sql(
pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant