snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

SNOW-571450: fetch_pandas_all() yields an unknown error. _query_result_format seems to != 'arrow'

Open lukaszbienkowski-ttc opened this issue 3 years ago • 3 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    3.9.5

  2. What operating system and processor architecture are you using?

macOS-12.3-arm64-arm-64bit

  1. What are the component versions in the environment (pip freeze)?

pyarrow==6.0.1 snowflake-connector-python==2.7.6 full requirements.txt attached req.txt

  1. What did you do?

` conn = snowflake.connector.connect( user=user, password=pwd, account=acc, warehouse=warehouse, database=db, schema=schema ) cs = conn.cursor()

cs.execute('select * from mappings_prod.mappings.brandmap') df = cs.fetch_pandas_all() `

  1. What did you expect to see?

df with data

  1. What did you see?

NotSupportedError Traceback (most recent call last) /var/folders/qw/yg514cqx2y7fg6h7ctnc2m8r0000gn/T/ipykernel_10069/420792028.py in ----> 1 df = cs.fetch_pandas_all()

~/.pyenv/versions/snowflake/lib/python3.9/site-packages/snowflake/connector/cursor.py in fetch_pandas_all(self, **kwargs) 972 self._prefetch_hook() 973 if self._query_result_format != "arrow": --> 974 raise NotSupportedError 975 self._log_telemetry_job_data( 976 TelemetryField.PANDAS_FETCH_ALL, TelemetryData.TRUE

NotSupportedError: Unknown error

  1. Can you set logging to DEBUG and collect the logs?

2022-04-07 11:41:42,898 - MainThread cursor.py:722 - execute() - DEBUG - sfqid: 01a371e5-0601-e38b-0011-f58303835152 2022-04-07 11:41:42,898 - MainThread cursor.py:722 - execute() - DEBUG - sfqid: 01a371e5-0601-e38b-0011-f58303835152 2022-04-07 11:41:42,899 - MainThread cursor.py:724 - execute() - INFO - query execution done 2022-04-07 11:41:42,899 - MainThread cursor.py:724 - execute() - INFO - query execution done 2022-04-07 11:41:42,900 - MainThread cursor.py:726 - execute() - DEBUG - SUCCESS 2022-04-07 11:41:42,900 - MainThread cursor.py:726 - execute() - DEBUG - SUCCESS 2022-04-07 11:41:42,901 - MainThread cursor.py:729 - execute() - DEBUG - PUT OR GET: None 2022-04-07 11:41:42,901 - MainThread cursor.py:729 - execute() - DEBUG - PUT OR GET: None 2022-04-07 11:41:42,902 - MainThread cursor.py:826 - _init_result_and_meta() - DEBUG - Query result format: json 2022-04-07 11:41:42,902 - MainThread cursor.py:826 - _init_result_and_meta() - DEBUG - Query result format: json 2022-04-07 11:41:42,903 - MainThread result_batch.py:446 - _parse() - DEBUG - parsing for result batch id: 10 2022-04-07 11:41:42,903 - MainThread result_batch.py:446 - _parse() - DEBUG - parsing for result batch id: 10

lukaszbienkowski-ttc avatar Apr 07 '22 09:04 lukaszbienkowski-ttc

Same here. Looks like arrow_iterator.cpython-39-darwin.so has only been built for intel not arm:

$ python -c 'from snowflake.connector.arrow_iterator import PyArrowIterator'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: dlopen(/Users/tekumara/code/app/.venv/lib/python3.9/site-packages/snowflake/connector/arrow_iterator.cpython-39-darwin.so, 0x0002): tried: '/Users/tekumara/code/app/.venv/lib/python3.9/site-packages/snowflake/connector/arrow_iterator.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

tekumara avatar May 02 '22 08:05 tekumara

Same here. Python 3.9.7 macOS-12.1-arm64-arm-64bit

Run

pip install 'snowflake-connector-python[pandas]'      

popcornylu avatar May 04 '22 04:05 popcornylu

See https://github.com/snowflakedb/snowflake-connector-python/issues/986#issuecomment-1115354587 which is a duplicate

tekumara avatar May 04 '22 05:05 tekumara

To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of March 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response

github-actions[bot] avatar Mar 10 '23 00:03 github-actions[bot]