Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use str instead of float to preserve precision #151

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

1yam
Copy link
Collaborator

@1yam 1yam commented Aug 19, 2024

This PR addresses an issue where using float to represent certain numerical values resulted in loss of precision due to rounding. By switching to str, we can maintain the exact value without rounding errors.

@1yam 1yam requested a review from nesitor August 19, 2024 15:06
Copy link

Summary:
The PR involves a small change where the required_tokens type from float to str is updated in the PriceResponse class. This change is unlikely to introduce bugs and is primarily focused on improving data consistency and type safety.

Highlight:

-    required_tokens: float
+    required_tokens: str

This change is straightforward and does not affect the overall functionality of the codebase, making it suitable for a routine review.

@github-actions github-actions bot added the BLUE This PR is simple and straightforward. label Aug 19, 2024
@1yam
Copy link
Collaborator Author

1yam commented Aug 19, 2024

Unit test should work need PR merge

@hoh hoh marked this pull request as draft August 19, 2024 15:10
@hoh
Copy link
Member

hoh commented Aug 19, 2024

Converted to Draft, this should use the Decimal type in Python and ensuring that the upstream API returns the expected type.

@Psycojoker
Copy link
Collaborator

Apparently the other PR has been merged, should we resume this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLUE This PR is simple and straightforward.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants