cursor.description cuts of column for sql functions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Chạy bản tái hiện được cung cấp trên thiết lập Redshift được báo cáo và kiểm tra cur.description sau truy vấn chứa SUM(SALDO_EUR). Theo dõi cách tên cột được tạo cho các hàm SQL, sau đó xác minh rằng phần mô tả báo cáo toàn bộ biểu thức, bao gồm cả sum(saldo_euro), mà không thay đổi các trường khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Python
- Star
- 220
- Fork
- 86
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/amazon-redshift-python-driver
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
aws/amazon-redshift-python-driver#268 · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
aws/amazon-redshift-python-driver#265 · 1 bình luận · 4 reaction ·
-
VARBYTE is decoded into utf-8 Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của aws/amazon-redshift-python-driver
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100