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/06 18:42:00 UTC

[jira] [Created] (IMPALA-11975) Fix dictionary methods that became lazy

Joe McDonnell created IMPALA-11975:
--------------------------------------

             Summary: Fix dictionary methods that became lazy
                 Key: IMPALA-11975
                 URL: https://issues.apache.org/jira/browse/IMPALA-11975
             Project: IMPALA
          Issue Type: Sub-task
          Components: Infrastructure
    Affects Versions: Impala 4.3.0
            Reporter: Joe McDonnell


Dictionary methods like items, keys, values became lazy, similar to the other list functions. Existing code that relies on these methods producing lists immediately need to wrap the call in list(). The old iter* methods have been removed, so that code needs to be fixed up.

See: [https://python-future.org/compatible_idioms.html#dictionaries]

Replacing the iter* methods with the non-iter equivalent works fine in Python 3 (e.g. iteritems() becomes items()), but it is less efficient on Python 2. This is annoying, but since our Python code is not very performance sensitive and our intention is to remove Python 2, it doesn't seem useful to do complicated things to avoid it.

This corresponds to these Pylint checks:

dict-iter-method
dict-keys-not-iterating
dict-values-not-iterating



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