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

[jira] [Resolved] (IMPALA-11976) Fix use of deprecated functions / packages in Python3 (long, maxint, file, etc)

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

Joe McDonnell resolved IMPALA-11976.
------------------------------------
    Fix Version/s: Impala 4.3.0
         Assignee: Joe McDonnell
       Resolution: Fixed

> Fix use of deprecated functions / packages in Python3 (long, maxint, file, etc)
> -------------------------------------------------------------------------------
>
>                 Key: IMPALA-11976
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11976
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Infrastructure
>    Affects Versions: Impala 4.3.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Major
>             Fix For: Impala 4.3.0
>
>
> Python 3 removed several deprecated functions / types.
>  
> {noformat}
> # sys.maxint is removed, replace with sys.maxsize
> sys.maxint -> sys.maxsize
> # file() is removed, use open()
> file() -> open()
> # Long is gone, int is now equivalent to long, can use int from future
> from builtins import int
> long() -> int()
> # e.message is gone, replace with str(e) 
> e.message -> str(e){noformat}
> There are a grab bag of others like strings.letters becoming string.ascii_letters and codecs moving to a different package.
> This is also a good time to get the new behavior for round().
> See these descriptions:
> [https://python-future.org/compatible_idioms.html#file]
> [https://python-future.org/compatible_idioms.html#long-integers]
> This corresponds to these pylint checks:
> file-builtin
> long-builtin
> invalid-str-codec
> round-builtin
> deprecated-string-function
> sys-max-int
> exception-message-attribute
>  



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