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)

贡献指南

打开贡献指南

调研方向

Start by tracing the fetch_dataframe method and reproducing the reported values for REAL and DOUBLE PRECISION in Redshift. Compare the returned values with the input precision and existing connector behavior; done means the expected decimal values are returned without unintended floating-point digits, with a regression test covering both types.

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, python
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。