Consider making pandas an optional dependency
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 50/100
研究方向
開啟 src/databricks/sql/client.py,檢查 pandas 匯入和 _convert_arrow_table 方法,尤其是 disable_pandas 條件。移動匯入,使 pandas 僅在執行該轉換路徑時才需要,然後執行測試套件,並驗證解除安裝 pandas 後所示的 Connection 和 polars 範例仍能正常運作。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- Python
- 星號
- 233
- 分支
- 152
- 平均合併
- 21 小時 5 分鐘
- 30 天內合併 PR
- 10
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
databricks/databricks-sql-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 84/100
查看 databricks/databricks-sql-python 的全部 Issue
相似的 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
canonical/paas-charm#368 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
tech debt
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 1/5 1 小時以內 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
難度 1/5 1 小時以內 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·