No handlers could be found for logger "sqlalchemy.pool.impl.QueuePool"

132 views
Skip to first unread message

Ira Fuchs

unread,
Mar 3, 2020, 11:12:29 PM3/3/20
to sqlalchemy
Getting the message “ No handlers could be found for logger "sqlalchemy.pool.impl.QueuePool" when I run this script to read from a MSSQL dB
The code runs fine and delivers the data, but produces this error. 

from sqlalchemy import *
import pytds
import sqlalchemy_pytds

engine = create_engine(params )
from sqlalchemy import *
import pytds
import sqlalchemy_pytds
import getpass
p=getpass.getpass()
engine = create_engine('mssql+pytds://' + params)

con = engine.connect()

q = 'SELECT * from table'
rs= list(engine.execute(q))
for a in rs:
print(a)

Mike Bayer

unread,
Mar 4, 2020, 9:22:29 AM3/4/20
to noreply-spamdigest via sqlalchemy
the pool might be trying to emit an info message, not really sure, there is some complex process by which Python logging either auto-configures itself, or doesnt.  Since Alembic has the env.py call upon fileConfig(), that would be the logging config here.  Add a logging config for it to your alembic.ini:

[logger_sqlalchemy_pool]
level = INFO
handlers =
qualname = sqlalchemy.pool
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
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+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages