[ 
https://issues.apache.org/jira/browse/IMPALA-11980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe McDonnell resolved IMPALA-11980.
------------------------------------
    Fix Version/s: Impala 5.0.0
         Assignee: Joe McDonnell
       Resolution: Fixed

> Impala-shell should switch to absolute imports
> ----------------------------------------------
>
>                 Key: IMPALA-11980
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11980
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Clients
>    Affects Versions: Impala 4.3.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Major
>             Fix For: Impala 5.0.0
>
>
> Various tests import code from the shell codebase:
> {noformat}
> $ git grep 'from shell\..*import'
> custom_cluster/test_hs2_fault_injection.py:from shell.ImpalaHttpClient import 
> ImpalaHttpClient
> custom_cluster/test_hs2_fault_injection.py:from shell.impala_client import 
> ImpalaHS2Client
> custom_cluster/test_hs2_fault_injection.py:from shell.shell_exceptions import 
> HttpError
> custom_cluster/test_shell_interactive_reconnect.py:from shell.impala_shell 
> import ImpalaShell as ImpalaShellClass
> shell/test_cookie_util.py:from shell.cookie_util import (cookie_matches_path, 
> get_cookie_expiry,
> shell/test_shell_client.py:from shell.impala_client import 
> ImpalaBeeswaxClient, ImpalaHS2Client
> shell/test_shell_commandline.py:from shell.impala_shell import ImpalaShell as 
> ImpalaShellClass
> shell/test_shell_interactive.py:from shell.impala_shell import ImpalaShell as 
> ImpalaShellClass{noformat}
> The shell codebase currently uses relative imports, so when using Python 3, 
> the imports within the shell codebase will not work. For example, 
> impala_shell.py includes compatibility.py via a relative import:
> {noformat}
> from compatibility import _xrange as xrange{noformat}
> In order for this to work under Python 3, these relative imports will need to 
> be absolute. However, some ways of invoking the shell will fail with absolute 
> imports (e.g. bin/impala-shell.sh). Other form factors are fine with absolute 
> imports (e.g. pip installs into a venv).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to