Hello.

I'm using a connection pool backed by SQLAlchemy (1.2.1) to access a 
Postgresql (9.6) server using the psycopg2 (2.7.3.2) driver. I have the 
following pool configuration options set:

from sqlalchemy.dialects import postgresql
DATABASE_POOL_ARGS = {
    'max_overflow': 0,
    'pool_size': 3,
    'recycle': 3600,
    'timeout': 10,
    'pre_ping': True,
    'dialect': postgresql.dialect(),
}

Whenever an error occurs during the initial ping I get an exception:

'NoneType' object has no attribute 'Error'

on line 477 of file sqlalchemy/engine/default.py which is:

except self.dbapi.Error as err:

"self" in this case is an object of type 
"sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2". Instances of 
this class do not seem to have the "dbapi" attribute, only the class itself 
has it. Should I be passing the class and not an instance for the "dialect" 
option? I've tried that and got a different kind of error:

  File 
"//anaconda/envs/opp/lib/python3.6/site-packages/sqlalchemy/pool.py", line 
812, in _checkout
    result = pool._dialect.do_ping(fairy.connection)
TypeError: do_ping() missing 1 required positional argument: 
'dbapi_connection'

Any help would be appreciated, thanks.

André

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to