python 用のスノーフレーク コネクタを使用して、flask_socketio と eventlet を使用してスノーフレークに対してクエリを実行しようとすると、次のエラーが表示されます。これに関するヘルプは大歓迎です。
import snowflake.connector as scon
from flask import Flask
from flask_socketio import SocketIO
import eventlet
eventlet.monkey_patch()
def query():
# Gets the version
ctx = scon.connect(
user='xxx',
password='xxxxxxxx',
account='xxxxxx',
)
cs = ctx.cursor()
try:
cs.execute("SELECT current_version()")
one = cs.fetchone()
return 'Snowflake version={}'.format(one[0])
finally:
cs.close()
app = Flask(__name__)
socketio = SocketIO(app)
@app.route('/')
def query_route():
return query()
socketio.run(app,debug=False, host='localhost', port=5000)
受信したエラー:
Traceback (most recent call last):
File "/home/chad/miniconda2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/chad/miniconda2/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/chad/miniconda2/lib/python2.7/multiprocessing/pool.py", line 327, in _handle_workers
while thread._state == RUN or (pool._cache and thread._state != TERMINATE):
AttributeError: '_MainThread' object has no attribute '_state'
Exception in thread Thread-6:
Traceback (most recent call last):
File "/home/chad/miniconda2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/chad/miniconda2/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/chad/miniconda2/lib/python2.7/multiprocessing/pool.py", line 363, in _handle_tasks
cache[job]._set(ind + 1, (False, ex))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'