Consider making pandas an optional dependency
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
Research direction
Open src/databricks/sql/client.py and inspect the pandas import and _convert_arrow_table method, especially the disable_pandas condition. Move the import so pandas is only needed when that conversion path runs, then run the test suite and verify the shown Connection and polars example works after uninstalling pandas.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 233
- Forks
- 152
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
All issues in databricks/databricks-sql-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
🐛 Bug 🔔 Pending processing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jumpserver/jumpserver#17584 ·