Consider making pandas an optional dependency

オープン
#489 コメント 1 件 リアクション 12 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
50/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
pandas, python
領域
api, backend, databases

調査の方向性

src/databricks/sql/client.py を開き、pandas の import と _convert_arrow_table メソッド、特に disable_pandas 条件を調べてください。import を移動し、その変換パスが実行される場合にのみ 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分
マージ済み PR(30日)
10

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

databricks/databricks-sql-python のほかの issue

databricks/databricks-sql-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。