現在 Azure ML のexecute python script内で以下のようなコードを記述しています。(Python3.5)
pymongoでmongoDBから取得した結果をDataFrameで返却しようとしているのですが
下から2行目のlist(doc)をlist()に変えた際はエラーは出ないのですが
下記コードだと
"C:\pyhome\lib\site-packages\pymongo\topology.py", line 97, in select_servers self._error_message(selector))pymongo.errors.ServerSelectionTimeoutError:
のようなエラーが出ています。
エラーの原因、また改善内容についてご存知の方がいらしたら教えてください。
尚、node.jsですがfindの結果は正常に取得できており検索対象データは1万件程です。
■ソースコード
import pymongo
import pandas as pd
def azureml_main(dataframe1 = None, dataframe2 = None):
uri = "mongodb://xxxxx:yyyyyyyyyyyyyyy==@zzz.documents.azure.com:10255/?ssl=true&replicaSet=globaldb" client = pymongo.MongoClient(uri) db = client.dbName coll = db.colName doc = coll.find({'state': '0'}) df = pd.DataFrame(list(doc)) return df,
■エラー詳細
Error 0085: The following error occurred during script evaluation, please view the output log for more information:
---------- Start of error message from Python interpreter ----------
Caught exception while executing function: Traceback (most recent call last):
File "C:\server\invokepy.py", line 199, in batch
odfs = mod.azureml_main(*idfs)
File "C:\temp\39583d4d716943bb9da437155f47147b.py", line 31, in azureml_main
df = pd.DataFrame(list(doc))
File "C:\pyhome\lib\site-packages\pymongo\cursor.py", line 977, in next
if len(self.__data) or self._refresh():
File "C:\pyhome\lib\site-packages\pymongo\cursor.py", line 902, in _refresh
self.__read_preference))
File "C:\pyhome\lib\site-packages\pymongo\cursor.py", line 813, in __send_message
**kwargs)
File "C:\pyhome\lib\site-packages\pymongo\mongo_client.py", line 728, in _send_message_with_response
server = topology.select_server(selector)
File "C:\pyhome\lib\site-packages\pymongo\topology.py", line 121, in select_server
address))
File "C:\pyhome\lib\site-packages\pymongo\topology.py", line 97, in select_servers
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: xxx.documents.azure.com:10255: The write operation timed out
Process returned with non-zero exit code 1
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。