Closed epicwhale closed 9 months ago
After cloning this repo, and writing a very rudimentary script, I am able to repro this:
import logging
logging.basicConfig(level=logging.DEBUG)
import persistqueue
q = persistqueue.SQLiteQueue('tmp')
Output
INFO:persistqueue.common:Selected pickle protocol: '4'
INFO:persistqueue:No sqlite3 module found, sqlite3 based queues are not available
It looks like the culprit is the line below which suppresses a "No module named 'dbutils'" with a hardcoded log.
Is there a way to import SQLiteQueue only by circumventing the code in this init.py ?
Yes, this most likely caused by the missing DBUtils, I will fixit in a coming PR
@peter-wangxu hey thanks for looking into this. I was wondering what the proposed fix accomplishes? For users who simply use say the SQLiteQueue and never install the extras, it will still always emit a redundant log each time "INFO:persistqueue:DBUtils may not be installed, install via 'pip install persist-queue[extra]'".
Would a more useful solution be to not import any MySQLQueues' in init.py unless the user explicitly loads that module?
I just pip installed 0.8.1
pip install persist-queue
with no extras - and in a Jupyternotebook with Python 3.11.7 - when I try:I get an INFO log output in std:
No sqlite3 module found, sqlite3 based queues are not available
If I add a 'import sqlite3' at the top of the file, I don't get any error from Python, but this log still appears
Despite this log msg, the queue seems to be creating a sqlite db and working as intended. What's causing this false positive?