tekumara / fakesnow

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency resolution causes AttributeError: 'pyarrow.lib.RecordBatch' object has no attribute 'to_pylist'

tekumara opened this issue · comments

During dependency resolution we backtrack and resolve to snowflake-connector-python==2.6.1 and pyarrow==5.0.0:

make install

Collecting snowflake-connector-python!=3.0.1
  Using cached snowflake_connector_python-3.0.2-cp39-cp39-macosx_11_0_arm64.whl (13.7 MB)
  Using cached snowflake_connector_python-3.0.0-1-cp39-cp39-macosx_11_0_arm64.whl (13.7 MB)
  Using cached snowflake_connector_python-2.9.0-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
Collecting pyOpenSSL<23.0.0,>=16.2.0
  Using cached pyOpenSSL-22.1.0-py3-none-any.whl (57 kB)
Collecting snowflake-connector-python!=3.0.1
  Using cached snowflake_connector_python-2.8.3-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
  Using cached snowflake_connector_python-2.8.1-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
Collecting cryptography<39.0.0,>=3.1.0
  Using cached cryptography-38.0.4-cp36-abi3-macosx_10_10_universal2.whl (5.4 MB)
Collecting snowflake-connector-python!=3.0.1
  Using cached snowflake_connector_python-2.8.0-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
  Using cached snowflake_connector_python-2.7.12-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
  Using cached snowflake_connector_python-2.7.11-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB)
  Using cached snowflake_connector_python-2.7.9-cp39-cp39-macosx_11_0_arm64.whl (10.3 MB)
...
Collecting snowflake-connector-python[pandas]
  Using cached snowflake_connector_python-3.0.1-cp39-cp39-macosx_11_0_arm64.whl (13.7 MB)
Collecting pyarrow<5.1.0,>=5.0.0
  Using cached pyarrow-5.0.0-cp39-cp39-macosx_11_0_arm64.whl (12.3 MB)  

This causes test failures:

self = <fakesnow.fakes.DuckResultBatch object at 0x156b4eb50>, kwargs = {}

    def create_iter(
        self, **kwargs: dict[str, Any]
    ) -> (Iterator[dict | Exception] | Iterator[tuple | Exception] | Iterator[pyarrow.Table] | Iterator[pd.DataFrame]):
        if self._use_dict_result:
>           return iter(self._batch.to_pylist())
E           AttributeError: 'pyarrow.lib.RecordBatch' object has no attribute 'to_pylist'

fakesnow/fakes.py:366: AttributeError

Pinning to the latest snowflake-connector-python==3.0.3 causes pip install to backtrack docformatter:

Collecting docformatter~=1.5
  Downloading docformatter-1.6.3-py3-none-any.whl (27 kB)
  Downloading docformatter-1.6.2-py3-none-any.whl (27 kB)
  Downloading docformatter-1.6.1-py3-none-any.whl (27 kB)
  Using cached docformatter-1.6.0-py3-none-any.whl (27 kB)
  Using cached docformatter-1.5.1-py3-none-any.whl (24 kB)

Which suggests a conflict between the requirements of snowflake-connector-python==3.0.3 and docformatter>=1.5.1

The conflict is: