cursor.description cuts of column for sql functions
還沒有人認領這個 Issue。
評估
研究方向
針對回報的 Redshift 設定執行提供的重現,並在包含 SUM(SALDO_EUR) 的查詢之後檢查 cur.description。追蹤 SQL 函式的欄名如何產生,然後確認 description 回報完整的運算式,包括 sum(saldo_euro),且不變更其他欄位。
由索引模型根據 Issue 內容生成。
描述
Driver version
redshift-connector==2.1.1
Redshift version
Redshift 1.0.77292
Client Operating System
Windows 11
Python version
Python 3.9.5
Table schema
select
GS_PE
SC_PE
SUM(SALDO_EUR)
from
Table
Problem description
- Expected behaviour:
When we use functions such as sum() the query result should display the exact column name like we have defined in the SQL-Query - Actual behaviour:
When we use functions such as sum() the query result is missing the column name within the functions brackets - Error message/stack trace:
No error message for this issue. - Any other details that can be helpful:
Result:
('gs_pe', 1043, None, None, None, None, None)
('sc_pe', 1043, None, None, None, None, None)
('sum', 1700, None, None, None, None, None)
Expected Result:
('gs_pe', 1043, None, None, None, None, None)
('sc_pe', 1043, None, None, None, None, None)
('sum(saldo_euro)', 1700, None, None, None, None, None)
Python Driver trace logs
Sorry, I have no privileges to create tables on the Redshift DB.
Reproduction code
with conn.cursor() as cur:
cur.execute(sql)
tuples_list = cur.fetchall()
dataframe = pd.DataFrame(tuples_list, columns=[desc[0] for desc in cur.description], dtype="object")
for field in cur.description:
print(field)
- 主要語言
- Python
- 星號
- 220
- 分支
- 89
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/amazon-redshift-python-driver 的其他 Issue
-
docs: client_protocol_version missing from Connection Parameters table可能已有人在做 @reginaldalfret 於 12 天前認領。 未關閉
難度 1/5 1-3 小時 新手友好度 74/100
-
難度 4/5 3-5 天 新手友好度 30/100
aws/amazon-redshift-python-driver#268 · 2 個 reaction ·
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 5/5 一週以上 新手友好度 35/100
aws/amazon-redshift-python-driver#265 · 1 則留言 · 4 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
查看 aws/amazon-redshift-python-driver 的全部 Issue
相似的 Issue
-
Agentic
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
Imbad0202/academic-research-skills#979 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
reflex-dev/reflex#7561 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 62/100
prometheus-community/ansible#906 · 2 則留言 ·