A bug in flatten_id function

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Locate the flatten_id function in the repository and inspect how it handles keys whose values are null. Reproduce the case described in the issue, then verify that an existing null value does not create a new item and that the resulting *_id value matches the requested behavior.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
16
Forks
18
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from singer-io/tap-gitlab

All issues in singer-io/tap-gitlab

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.