Skip to content

util.ImmutableLazyDataList.__getitem__ not returning val if val is not None #112

@aalba6675

Description

@aalba6675

Example 3-read_from_a_map.py is currently failing on master and tag v3.9.

list(greetings_map.key_set().result()) = [None, None, None, None, None]

Root cause is that we are not returning val if it is not None.

class ImmutableLazyDataList(Sequence):
    def __getitem__(self, index):
        val = self._list_obj[index]
        if not val:
            data = self._list_data[index]
            if isinstance(data, tuple):
                (key, value) = data
                self._list_obj[index] = (self.to_object(key), self.to_object(value))
            else:
                self._list_obj[index] = self.to_object(data)
            return self._list_obj[index]
## this should be unindented
        return self._list_obj[index]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions