What language are you using?
Python
What version are you using?
connectorx 0.4.4
What database are you using?
PostgreSQL (AWS RDS, sslmode=require)
What dataframe are you using?
Arrow / Arrow Streaming
Can you describe your bug?
return_type="arrow_stream" panics at connectorx/src/get_arrow.rs:318:22 (or :355 with protocol="cursor") during the initial Postgres connection setup when the URL has sslmode=require. The wrapped error is stripped to PostgresPoolError(Error(None)) because the streaming path uses .unwrap() where the bulk path (get_arrow) uses ?.
The exact same URL works in return_type="arrow".
What are the steps to reproduce the behavior?
import connectorx as cx
url = "postgresql://user:pass@host:5432/db?sslmode=require"
# Works
arrow = cx.read_sql(url, "SELECT 1", return_type="arrow")
print("arrow OK:", arrow.num_rows)
# Panics
reader = cx.read_sql(url, "SELECT 1", return_type="arrow_stream")
list(reader)
What is the error?
thread '<unnamed>' panicked at /Users/.../connectorx/src/get_arrow.rs:318:22:
called `Result::unwrap()` on an `Err` value: PostgresPoolError(Error(None))
(r2d2 runtime log surfaces the real cause:)
[r2d2] error communicating with the server: Connection reset by peer (os error 54)
Test matrix
|
No SSL |
sslmode=require |
return_type="arrow" |
✓ |
✓ |
return_type="arrow_stream" |
✓ |
✗ panic |
Tried protocol={binary, cursor, simple} — binary and cursor both panic identically at different line numbers (get_arrow.rs:318 and :355); simple is not implemented. Connection environment doesn't matter (reproducible with direct DSN and over an SSH tunnel).
Related
These all point at arrow_stream being a separately-implemented codepath with rougher edges than arrow. This issue adds SSL handshake to that list.
Suggested fix (visibility, at minimum)
Two .unwrap() calls in new_record_batch_iter should be ? (with #[throws(...)] on the function) to mirror get_arrow's error handling. That alone would surface the underlying r2d2 error instead of stripping it to Error(None). The root cause (why r2d2 connection setup fails under arrow_stream but not arrow with identical inputs) is a separate question worth tracing.
What language are you using?
Python
What version are you using?
connectorx 0.4.4
What database are you using?
PostgreSQL (AWS RDS,
sslmode=require)What dataframe are you using?
Arrow / Arrow Streaming
Can you describe your bug?
return_type="arrow_stream"panics atconnectorx/src/get_arrow.rs:318:22(or:355withprotocol="cursor") during the initial Postgres connection setup when the URL hassslmode=require. The wrapped error is stripped toPostgresPoolError(Error(None))because the streaming path uses.unwrap()where the bulk path (get_arrow) uses?.The exact same URL works in
return_type="arrow".What are the steps to reproduce the behavior?
What is the error?
Test matrix
return_type="arrow"return_type="arrow_stream"Tried
protocol={binary, cursor, simple}—binaryandcursorboth panic identically at different line numbers (get_arrow.rs:318and:355);simpleis not implemented. Connection environment doesn't matter (reproducible with direct DSN and over an SSH tunnel).Related
arrowandarrow_streamarrow_streamThese all point at
arrow_streambeing a separately-implemented codepath with rougher edges thanarrow. This issue adds SSL handshake to that list.Suggested fix (visibility, at minimum)
Two
.unwrap()calls innew_record_batch_itershould be?(with#[throws(...)]on the function) to mirrorget_arrow's error handling. That alone would surface the underlying r2d2 error instead of stripping it toError(None). The root cause (why r2d2 connection setup fails underarrow_streambut notarrowwith identical inputs) is a separate question worth tracing.