Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug in flatten_id function #22

Open
EastGaint opened this issue Oct 22, 2020 · 0 comments
Open

A bug in flatten_id function #22

EastGaint opened this issue Oct 22, 2020 · 0 comments

Comments

@EastGaint
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant