Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 4.3.0
-
None
-
ghx-label-7
Description
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