[ 
https://issues.apache.org/jira/browse/IMPALA-11980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17902374#comment-17902374
 ] 

Joe McDonnell commented on IMPALA-11980:
----------------------------------------

Example test error:
{noformat}
query_test/test_queries.py:414: in 
test_partition_key_scans_with_multiple_blocks_table
    result = self.execute_query_expect_success(self.client,
common/impala_test_suite.py:969: in wrapper
    return function(*args, **kwargs)
common/impala_test_suite.py:979: in execute_query_expect_success
    result = cls.__execute_query(impalad_client, query, query_options, user)
common/impala_test_suite.py:1128: in __execute_query
    return impalad_client.execute(query, user=user)
common/impala_connection.py:219: in execute
    return self.__beeswax_client.execute(sql_stmt, user=user,
beeswax/impala_beeswax.py:217: in execute
    result.exec_summary = self.get_exec_summary_and_parse(handle)
beeswax/impala_beeswax.py:249: in get_exec_summary_and_parse
    self.__build_summary_table(summary, output)
beeswax/impala_beeswax.py:253: in __build_summary_table
    from shell.impala_client import build_exec_summary_table
../shell/impala_client.py:21: in <module>
    from compatibility import _xrange as xrange
E   ModuleNotFoundError: No module named 'compatibility'{noformat}

> 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
>            Priority: Major
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to