从snowflake.connector导入连接为snowflake_connector
from snowflake.connector import connect
SNOWFLAKE_ACCOUNT = r'my_account'
SNOWFLAKE_USERNAME = r'my_username'
SNOWFLAKE_PASSWORD = r'my_password'
try:
conn = connect(
user=SNOWFLAKE_USERNAME,
password=SNOWFLAKE_PASSWORD,
account=SNOWFLAKE_ACCOUNT,
warehouse='W1',
database='DB1',
schema='SC1'
)
except Exception as e:
raise e
这过去很好,但是我必须升级了一些东西或者做了一些更改--现在它导致了这个错误(在VS Code的木星笔记本中,它也是内核崩溃):
Canceled future for execute_request message before replies were done
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
我不想使用sqlalchemy或pd.read_sql,因为我使用pyarrow格式进行数据传输。
有什么想法吗?使用雪花连接器2.8.2和py箭头8.0.0
以下是木星日志的回溯:似乎问题在于traitlets (我有5.4.0版)
info 15:24:44.741: Started Kernel Python 3.10.7 64-bit (pid: 4548)
info 15:24:44.747: UpdateWorkingDirectoryAndPath in Kernel
error 15:24:47.233: Disposing session as kernel process died ExitCode: 3221225725, Reason: c:\Users\mkleinbort\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2412: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
warn(
c:\Users\mkleinbort\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2366: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'cd273979-f6a3-426f-b65e-7098ec266fa7' instead of 'b"cd273979-f6a3-426f-b65e-7098ec266fa7"'.
warn(
info 15:24:47.233: Dispose Kernel process 4548.
error 15:24:47.233: Raw kernel process exited code: 3221225725
error 15:24:47.234: Error in waiting for cell to complete [Error: Canceled future for execute_request message before replies were done
at t.KernelShellFutureHandler.dispose (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:32353)
at c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:51405
at Map.forEach (<anonymous>)
at y._clearKernelState (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:51390)
at y.dispose (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:44872)
at c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:2218404
at t.swallowExceptions (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:7:130943)
at p.dispose (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:2218382)
at t.RawSession.dispose (c:\Users\mkleinbort\.vscode\extensions\ms-toolsai.jupyter-2022.9.1303220346\out\extension.node.js:2:2223490)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)]
warn 15:24:47.235: Cell completed with errors {
message: 'Canceled future for execute_request message before replies were done'
}
info 15:24:47.237: Cancel all remaining cells true || Error || undefined
warn 15:24:47.247: 2022-11-25 15:24:47,237 UTC - WARNING - Unknown command: DISPOSE_INTERRUPT_HANDLE:11:2568
发布于 2022-11-29 11:10:32
这可能与https://github.com/snowflakedb/snowflake-connector-python/issues/1342有关(其中描述了雪花本地缓存造成的冻结)。
该bug目前提到2.8.3修复了问题。
https://stackoverflow.com/questions/74574866
复制相似问题