You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2023/03/07 00:54:00 UTC

[jira] [Created] (IMPALA-11980) Impala-shell should switch to absolute imports

Joe McDonnell created IMPALA-11980:
--------------------------------------

             Summary: 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


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)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org