public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chapman Flack <[email protected]>
To: [email protected]
Subject: Re: Detecting test failures reported as warnings
Date: Wed, 8 Jul 2020 17:37:10 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<CAASLQ4OXAb+_J=oK54PH5eYuXjkV9KMsoXEcp-TYaQPqxk1Xbg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAASLQ4PfvmgKPp+aFf_r5RsBwigc+EC5Hm2CuzwJSTDCT64i-A@mail.gmail.com>
	<[email protected]>
	<CAASLQ4Px21jyb2vJYSrjF5P0RqhA-G_DDWR9QHG68r+W+AqbxQ@mail.gmail.com>
	<CAASLQ4NYE-TW6hjbkSOuAY2Z4NM2cYzqSQ9ahO2LAUhdP9axeQ@mail.gmail.com>
	<[email protected]>
	<CAASLQ4Od6-0=3+4ENKh1Z-Wcu5Wir-bwUn_ccO2UCmDhoR4vtQ@mail.gmail.com>
	<[email protected]>
	<CAASLQ4OzPwZB6GG_cXNW4WU4zpHa6wm8Q3WRWNv5pZpis+gf3w@mail.gmail.com>
	<[email protected]>
	<CAASLQ4P8e9XfUh17HFhYE4eMtq5-C4dpHQAX+hCsia-UFNAjtA@mail.gmail.com>
	<[email protected]>
	<CAASLQ4PoMTiTZUPxTR7VS8LLo9tosAMu-89T5ikWub7VbM+r4Q@mail.gmail.com>
	<[email protected]>

On 06/17/20 15:31, Chapman Flack wrote:
> I was looking at the various Python driver choices myself the other night
> and it wasn't as promising as I thought. pg8000 was the pure-Python one
> that I remembered, but can't access warnings (as far as I can tell).

For the record, so no future reader of this thread is misinformed, I was
wrong about that. pg8000 does make notices/warnings available, using the
'notices' property of a pg8000 Connection. It is a deque that will hold
the most recent not-more-than-100 that were received. popleft() will
retrieve them in arrival order.

Each item is a dict that presents all of the fields of the PostgreSQL
notice, keyed by their single-character codes:

https://www.postgresql.org/docs/9.6/protocol-error-fields.html

So, not only was I mistaken to say "can't access", it in fact provides
better access than many other PG drivers.

Errors are a bit botched: those raise exceptions of course, and the
exception will have a tuple of values. Those are the values of all
the fields received from PostgreSQL, just as in the warning case, but
with all the keys thrown away, leaving you to guess which field is which.

-Chap





view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Detecting test failures reported as warnings
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox