aws / aws/amazon-redshift-python-driver
fetch_dataframe returning float types incorrectly
- Dominant language
- Python
- Stars
- 220
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
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.


Contributor guide
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100