Pandas makes bad DESCRIBE query when using SQLAlchemy
@susodapop 已經在處理了。
開始於 2023年8月3日。
評估
這個 Issue 還沒有評估資料。
描述
When using the SQLAlchemy engine with Pandas, it seems that Pandas makes a bad DESCRIBE query. Here is the code:
import os
import pandas as pd
from sqlalchemy import create_engine
server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME")
http_path = os.getenv("DATABRICKS_HTTP_PATH")
access_token = os.getenv("DATABRICKS_TOKEN")
engine = create_engine(
f"databricks://token:{access_token}@{server_hostname}?http_path={http_path}&catalog=hive_metastore&schema=default",
)
with engine.connect() as connection:
print(pd.read_sql("SELECT * FROM test", connection))
Here are the two query resulting from that code:
It does not do that when using SQL connector instead:
import os
import pandas as pd
from databricks import sql
with sql.connect(
server_hostname=os.getenv("DATABRICKS_SERVER_HOSTNAME"),
http_path=os.getenv("DATABRICKS_HTTP_PATH"),
access_token=os.getenv("DATABRICKS_TOKEN"),
) as connection:
print(pd.read_sql("SELECT * FROM test", connection))
Here are version numbers:
In [1]: import sqlalchemy
In [2]: sqlalchemy.__version__
Out[2]: '1.4.49'
In [3]: from databricks import sql
In [4]: sql.__version__
Out[4]: '2.8.0'
- 主要語言
- 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
-
essnmx good first issue
難度 1/5 1 小時以內 新手友好度 95/100
-
難度 2/5 1-3 小時 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 則留言 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未關閉area: repo bug perceived difficulty: 2
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
yeti-platform/yeti#1380 ·