Skip to content

Consider making pandas an optional dependency #489

Open

Description

@FBruzzesi

Description

Currently pandas is a hard requirement for the library, however not necessarily used.

By delaying pandas import in src/databricks/sql/client.py from the top of the file to _convert_arrow_table method after the if self.connection.disable_pandas is True: condition it would be possible to make pandas an optional dependency.

I was able to run all the tests with this change flawlessly, as well as uninstalling pandas and then run the following:

import polars as pl
from databricks.sql.client import Connection

credentials = ...
query = ...

conn = Connection(
    server_hostname=credentials["server_hostname"],
    http_path=credentials["http_path"],
    access_token=credentials["access_token"],
)

dframe = pl.read_database(query, conn)

without any issue

Activity

  1. changed the title [-]Make pandas an optional dependency[/-] [+]Consider making pandas an optional dependency[/+] on Jan 17, 2025
  2. gs11 commented on Mar 24, 2025

    @gs11

    Adding to this - the size of pandas makes it really hard to run this in e.g. an AWS Lambda environment where total deployment package size is limited.

  3. snowman2 commented on Oct 30, 2026

    @snowman2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions