jorisvandenbossche commented on code in PR #425:
URL: https://github.com/apache/arrow-nanoarrow/pull/425#discussion_r1563082909
##########
python/src/nanoarrow/iterator.py:
##########
@@ -263,6 +263,25 @@ def _binary_iter(self, offset, length):
for start, end in zip(starts, ends):
yield bytes(data[start:end])
+ def _decimal_iter(self, offset, length):
+ from decimal import Context, Decimal
+ from sys import byteorder
+
+ storage = self._primitive_iter(offset, length)
+ precision = self._schema_view.decimal_precision
+ scaleb = Decimal(-self._schema_view.decimal_scale)
Review Comment:
Does this need to be converted to a Decimal?
The docs seem to suggest this can be just an integer
(https://docs.python.org/3/library/decimal.html#decimal.Decimal.scaleb)
Also, I might add some comments about what is going on for people not
familiar with this method (I had to look it up to understand what you wrote,
but certainly makes sense now)
--
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]