aws / aws/amazon-redshift-python-driver

fetch_dataframe returning float types incorrectly

未關閉
#259 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
220
分支
86
PR 合併指標
30 天內沒有已合併 PR

描述

The **fetch_dataframe** method provided by the Redshift connector appears to return more decimal places than expected. For example, 0.074 becomes 0.07400000095367, likely due to how Redshift stores and retrieves floating-point or decimal values with higher precision than originally intended.

The first image shows what was returned by the **fetch_dataframe** method and although the revenue growth column is exactly what we expected (exact user inputs without more decimal places), when we actually take a look at one of the values specifically (second one in this case), we get the value in the second image. This suggests that fetch_dataframe is already returning extra decimal places but just not viewable when printing the whole dataframe. For now, we have identified that this is a problem for the datatypes **REAL** and **DOUBLE PRECISION** on the redshift connector.
![Image](https://github.com/user-attachments/assets/b9c2b3f6-8de3-40f0-8a17-e6d08a9c86f2)
![Image](https://github.com/user-attachments/assets/8893e18e-d4e9-4a3d-b610-122c268e4b49)

貢獻指南

開啟貢獻指南

研究方向

首先追蹤 fetch_dataframe 方法,並在 Redshift 中重現 REAL 和 DOUBLE PRECISION 的回報值。將回傳值與輸入精度及現有 connector 行為進行比較;當回傳預期的小數值且不包含非預期的浮點數字,並且有一個涵蓋這兩種類型的回歸測試時,即表示完成。

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

評估

技術堆疊
aws, python
領域
databases
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
38/100

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

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