I use python snowflake connector in my python script (plotly dash app) and today the app stopped working without me changing the code. I tried a couple of things to find out what might be the issue and I even tried to run the example code from Snowflake documentation and I got the same error:
code:
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()
error:
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
The connection is established, I am capable of creating a table in my database but I cannot seem to query and iterate the data.
I am on macOS Catalina 10.15.1
, snowflake-connector-python==2.1.0
, Python 3.7.0
.
To verify your driver version, connect to Snowflake through a client application that uses the driver and check the version. If the application supports executing SQL queries, you can call the CURRENT_CLIENT function. ODBC Driver: ODBC Data Source Administration Tool (Windows)
Using the Query ID to Retrieve the Results of a Query Get the query ID of the query. See Retrieving the Snowflake Query ID. Call the get_results_from_sfqid() method in the Cursor object to retrieve the results. Use the Cursor object to fetch the values in the results, as explained in Using cursor to Fetch Values.
You have to install pyarrow module via
pip3 install pyarrow
Installation of the snowflake connector does not automatically install it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With