pitrou commented on a change in pull request #11322:
URL: https://github.com/apache/arrow/pull/11322#discussion_r742193861
##########
File path: dev/archery/archery/integration/datagen.py
##########
@@ -431,23 +431,10 @@ def generate_column(self, size, name=None):
return PrimitiveColumn(name, size, is_valid, values)
-DECIMAL_PRECISION_TO_VALUE = {
- key: (1 << (8 * i - 1)) - 1 for i, key in enumerate(
- [1, 3, 5, 7, 10, 12, 15, 17, 19, 22, 24, 27, 29, 32, 34, 36,
- 40, 42, 44, 50, 60, 70],
- start=1,
- )
-}
-
-
def decimal_range_from_precision(precision):
assert 1 <= precision <= 76
- try:
- max_value = DECIMAL_PRECISION_TO_VALUE[precision]
- except KeyError:
- return decimal_range_from_precision(precision - 1)
- else:
- return ~max_value, max_value
+ max_value = (10 ** precision) - 1
+ return ~max_value, max_value
Review comment:
Shouldn't it actually be `-max_value, max_value`?
--
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]