Skip to content

A bug in flatten_id function #22

@EastGaint

Description

@EastGaint

The judgement is not correct, sometime if the key is exist but value is null, a new item will be created. I suggest the next codes:
def flatten_id(item, target): if target in item: if item[target] is not None: item[target + '_id'] = item.pop(target, {}).pop('id', None) return else: item.pop(target, {}) item[target + '_id'] = None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions