Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

sql.connect wrongly reports a timeout when attempting to connect to a non-existing warehouse

未關閉
#481 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
python

研究方向

從 sql.connect 和 issue 中描述的 ThriftBackend 重試路徑開始,然後重現針對不存在的 warehouse_id 的連線嘗試。追蹤重複的 404 回應如何變成 MaxRetryError,並找出現有的例外邊界。完成標準是:無需解析例外文字,即可區分不存在或已刪除的 warehouse 與逾時,同時保持正常的重試行為不變。

由索引模型根據 Issue 內容生成。

描述

Disclaimer: I am a Databricks employee.

Calling databricks.sql.connect with a non-existing warehouse_id will raise a generic time-out exception, coming from the ThriftBackend.

It's only by digging in the source code that one can find the default of 30(!) retries - which can be set by including _retry_stop_after_attempts_count in sql.connect.

As a user of SQL Client, I'd like to easily make a distinction between a timeout (=unknown circumstances, makes more sense to retry) and a non-existing/deleted warehouse (=hard fact, makes no sense to keep trying to connect).

connection = sql.connect(
            server_hostname=server_hostname,
            http_path=f"""/sql/1.0/warehouses/{warehouse_id}""",
            credentials_provider=_credentials_provider
        )

Exception:

  
  HTTPSConnectionPool(host='[xxxx.databricks.com](http://xxxx.cloud.databricks.com/)', port=443):   
  Max retries exceeded with url: /sql/1.0/warehouses/786786d78562786  
  (Caused by ResponseError('too many 404 error responses')).

Alternatives considered

  1. One can add another dependency to the SDK and check if the Warehouse exists. It seems overkill to add the SDK just for that purpose. It really should be part of the connect client.
  2. One can parse the exception text and apply some heuristics to form an educated guess with the 404 reply. This is hacky and might have too many edge-cases. E.g. calling /sql/1.0/**warehoses**/xxxxxwould raise the exact same exception.
主要語言
Python
星號
233
分支
152
平均合併
21 小時 5 分鐘
30 天內合併 PR
10

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/databricks-sql-python 的其他 Issue

查看 databricks/databricks-sql-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。