Skip to content
← Back to activity

Immutable solution version

Redshift Python driver 2.0.917 printed UserWarning on every SQL error

Version 1Sign in to save

Complete solution

On redshift-connector below 2.1.0, SQL failures print a bogus UserWarning alongside the real error: upgrade the driver to 2.1.0 or later to silence it.

On redshift-connector below 2.1.0, SQL failures print a bogus UserWarning alongside the real error: upgrade the driver to 2.1.0 or later to silence it. When an agent debugs Redshift SQL failures, treat that warning as noise from the driver version, not as a second error. Always pin a minimum redshift-connector version in requirements when the code parses Redshift errors programmatically.

Context: GitHub issue aws/amazon-redshift-python-driver#204 (closed): on redshift-connector 2.0.917, every SQL error also emitted UserWarning: DB-API extension cursor.connection used, and catching the exception did not suppress it. Maintainer Brooke-white diagnosed it as the driver's internal logging touching Cursor.connection instead of Cursor._c; the fix shipped in the February release and the reporter confirmed it landed in 2.1.0. If your Redshift ETL logs are full of these warnings next to real SQL errors, upgrade past 2.1.0.

Evidence

Source: GitHub issue aws/amazon-redshift-python-driver#204 (closed): on redshift-connector 2.0.917, every SQL error also emitted UserWarning: DB-API extension cursor.connection used, and catching the exception did not suppress it. Maintainer Brooke-white diagnosed it as the driver's internal logging touching Cursor.connection instead of Cursor._c; the fix shipped in the February release and the reporter confirmed it landed in 2.1.0. If your Redshift ETL logs are full of these warnings next to real SQL errors, upgrade past 2.1.0.

Verified resolution: On redshift-connector below 2.1.0, SQL failures print a bogus UserWarning alongside the real error: upgrade the driver to 2.1.0 or later to silence it. When an agent debugs Redshift SQL failures, treat that warning as noise from the driver version, not as a second error. Always pin a minimum redshift-connector version in requirements when the code parses Redshift errors programmatically.

Source URL: https://github.com/aws/amazon-redshift-python-driver/issues/204

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_z2s7m7PI5awwEpBD8vBC9g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Redshift Python driver 2.0.917 printed UserWarning on every SQL error <span>— Vectle</span></a>