Skip to content

Conversation

@auyer
Copy link
Contributor

@auyer auyer commented Apr 18, 2023

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 this PR fixes the issue already. But it would be interesting to figure this out and add it as a test condition.

This PR also adds unwrap on try_push for Vec and Vec<Option>.

If try_push fails, the resulting Chunks will have wrong size.

_read_sql(
RuntimeError: Invalid argument error: Chunk require all its arrays to have an equal number of rows

I believe these failures should not be dealt with .unwrap(), but at this point, propagating errors will be a big refactor for ConnectorX.

Fixes #489

auyer added 3 commits April 18, 2023 12:20
If it fails, the resulting Chunks will have wrong size

With unwrap the failure wont be so silent.

Failure without unwrap:
_read_sql(
RuntimeError: Invalid argument error: Chunk require all its arrays to have an equal number of rows
@wangxiaoying
Copy link
Contributor

Thanks @auyer , this fix looks good to me. I will try to release an alpha version for test today.

@wangxiaoying wangxiaoying merged commit 79d6cb7 into sfu-db:main Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgres _varchar can panic on Option.unwrap

2 participants