Skip to content

SNOW-710684: Unable to use Cursor method fetch_arrow_all() without pandas installed #1375

@ir3456

Description

@ir3456

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    3.10.8

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

    macOS-12.4-arm64-arm-64bit

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

    pyarrow==8.0.0
    snowflake-connector-python==2.8.3

  4. What did you do?

I tried to use the Cursor method fetch_arrow_all() without pandas as a dependency which threw the following error:
NameError: name 'concat_tables' is not defined in the snowflake/connector/result_set.py module.

concat_tables and pyarrow are only imported if the installed_pandas variable is True. Tracing installed_pandas back, it is True when from pandas import DataFrame runs without an error.

Essentially, pyarrow and concat_tables are only imported if pandas is installed in the environment, thus using the fetch_arrow_all() method unnecessarily requires pandas as a dependency.

For use cases not requiring pandas (such as using polars) it would be nice not to have pandas as an unnecessary dependency but still be able to use the pyarrow functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions