You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2022/05/23 22:43:21 UTC

[impala] 04/05: IMPALA-11305: Fix TypeError in impala-shell summary progress

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 cf5eaae17634edd99f40bd40e83ea1f1248e4bf1
Author: Riza Suminto <ri...@cloudera.com>
AuthorDate: Thu May 19 21:12:32 2022 -0700

    IMPALA-11305: Fix TypeError in impala-shell summary progress
    
    impala-shell fail with TypeError when installed with python3. This is
    due to behavior change of division operator ('/') between python2 vs
    python3. This patch fix the issue by changing the operator with floor
    division ('//') that result in integer type as described in
    https://peps.python.org/pep-0238/.
    
    Testing:
    - Manually install impala-shell with from pip with python3 and verify
      the fix works.
    
    Change-Id: Ifbe4df6a7a4136e590f383fc6475e2283e35eadc
    Reviewed-on: http://gerrit.cloudera.org:8080/18546
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Michael Smith <mi...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 shell/impala_shell.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/impala_shell.py b/shell/impala_shell.py
index a2bd4fb2d..50ad5eaa1 100755
--- a/shell/impala_shell.py
+++ b/shell/impala_shell.py
@@ -1245,7 +1245,7 @@ class ImpalaShell(cmd.Cmd, object):
           return
 
         if self.live_progress and progress.total_scan_ranges > 0:
-          val = ((summary.progress.num_completed_scan_ranges * 100) /
+          val = ((summary.progress.num_completed_scan_ranges * 100) //
                  summary.progress.total_scan_ranges)
           fragment_text = "[%s%s] %s%%\n" % ("#" * val, " " * (100 - val), val)
           data += fragment_text