SophieTech88 commented on code in PR #5354:
URL: https://github.com/apache/gravitino/pull/5354#discussion_r1828661051


##########
clients/client-python/gravitino/api/decimal.py:
##########
@@ -0,0 +1,59 @@
+from decimal import Decimal as PyDecimal, ROUND_HALF_UP
+from typing import Union
+from .types import Types
+
+
+class Decimal:

Review Comment:
   Thank you so much to point out the reason why we need to wrap Java 
BigDecimal. Then I just double checked for Python PyDecimal, it tends to handle 
this more intuitively for currency by counting all visible digits. So for 
example:
   ```
   from decimal import Decimal
   
   value = Decimal("0.01") ## it is 2
   print("Precision:", value.adjusted() + 1)  ## it is 2 
   print("Scale:", -value.as_tuple().exponent)
   ```
   So PyDecimal didn't have the similar issue like Java BigDecimal. 
   I will remove the new change for decimal.py.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to