This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit b90d636407dc8562b72e7d15542ffe45cc45036f
Author: Joe McDonnell <[email protected]>
AuthorDate: Tue May 27 15:25:59 2025 -0700

    IMPALA-14104: Fix TestDecimalFuzz on Python 3
    
    TestDecimalFuzz uses division to calculate the number of
    iterations for certain tests. On Python 3, division produces
    a float and range() will not take a float as an argument.
    In theory, the "from __future__ import division" was supposed
    to produce the same behavior on Python 2 and 3, but in practice,
    the "from builtins import range" allows a float argument to
    range() on Python 2 but not Python 3.
    
    This fixes the issue by explicitly casting to an integer.
    
    Testing:
     - Ran TestDecimalFuzz with Python 3
    
    Change-Id: I4cd4daecde690bf41a4e412c02c23cbb6ae5a14c
    Reviewed-on: http://gerrit.cloudera.org:8080/22955
    Reviewed-by: Riza Suminto <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/query_test/test_decimal_fuzz.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/query_test/test_decimal_fuzz.py 
b/tests/query_test/test_decimal_fuzz.py
index 93eb858df..c29d33104 100644
--- a/tests/query_test/test_decimal_fuzz.py
+++ b/tests/query_test/test_decimal_fuzz.py
@@ -44,7 +44,7 @@ class TestDecimalFuzz(ImpalaTestSuite):
 
     total_iterations = 10000
     batches = list(range(0, 10))
-    cls.iterations = total_iterations / len(batches)
+    cls.iterations = total_iterations // len(batches)
     cls.ImpalaTestMatrix.add_dimension(ImpalaTestDimension("test_batch", 
*batches))
     add_mandatory_exec_option(cls, 'decimal_v2', 'true')
     add_mandatory_exec_option(cls, 'long_polling_time_ms', 100)

Reply via email to