aws / aws/amazon-redshift-python-driver

fetch_dataframe returning float types incorrectly

オープン
#259 コメント 0 件 リアクション 1 件 担当者 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 について報告された値を再現します。返された値を入力の精度および既存のコネクタの動作と比較します。両方の型を対象とする回帰テストがあり、意図しない浮動小数点の桁を含まずに期待される小数値が返されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, python
領域
databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。