使用雪花连接器提取数据引发EmptyPyArrowIterator错误

问题描述

我在我的python脚本中使用了python雪花连接器(策划式划线应用程序),今天这个应用程序在我没有更改代码的情况下停止工作。我尝试了几种方法来找出可能的问题所在,我甚至尝试运行Snowflake documentation中的示例代码,但得到了相同的错误:

编码:

cur = conn.cursor()
try:
    cur.execute("SELECT col1, col2 FROM test_table ORDER BY col1")
    for (col1, col2) in cur:
        print('{0}, {1}'.format(col1, col2))
finally:
    cur.close()

错误:

Traceback (most recent call last):
  File "db_connection.py", line 48, in <module>
    cur.execute("SELECT col1, col2 FROM test_table ORDER BY col1")
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/snowflake/connector/cursor.py", line 580, in execute
    self._init_result_and_meta(data, _use_ijson)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/snowflake/connector/cursor.py", line 630, in _init_result_and_meta
    self._result = ArrowResult(data, self, use_dict_result=self._use_dict_result)
  File "arrow_result.pyx", line 42, in snowflake.connector.arrow_result.ArrowResult.__init__
  File "arrow_result.pyx", line 156, in snowflake.connector.arrow_result.ArrowResult._reset
NameError: name 'EmptyPyArrowIterator' is not defined

连接已建立,我能够在数据库中创建表,但似乎无法查询和迭代数据。

我在macOS Catalina 10.15.1snowflake-connector-python==2.1.0Python 3.7.0上。


解决方案

请使用Python连接器版本2.1.1

pip安装雪花连接器-python==2.1.1

PIP3安装雪花连接器-python==2.1.1

相关文章