Skip to content

fix some keys will be ignored!#54

Open
sudor wants to merge 2 commits into
amirziai:masterfrom
sudor:master
Open

fix some keys will be ignored!#54
sudor wants to merge 2 commits into
amirziai:masterfrom
sudor:master

Conversation

@sudor

@sudor sudor commented Sep 9, 2019

Copy link
Copy Markdown

eg: list_keys[i] = a.b.c and list_keys[i + 1]=a.b.cx, the key 'a.b.c' would be ignored!

Summary

The summary should expand on the title of the pull request. What is the expected effect of the
pull request? Specifically, indicate how the behavior will be different than before the pull
request.

Bug Fixes/New Features

  • Bullet list overview of bug fixes or new features added.

How to Verify

How can reviewers verify the request has the intended effect? This should include descriptions of
any new tests that are added or old tests that are updated. It should also indicate how the code
was tested.

Side Effects

Does the pull request contain any side effects? This should list non-obvious things that have
changed in the request.

Resolves

Fixes RID-1234
Fixes AMG-1234

Tests

What tests were created or changed for this feature or fix? Do all tests pass, and if not, why?

Code Reviewer(s)

@, @

eg: list_keys[i] = a.b.c and list_keys[i + 1]=a.b.cx, the key 'a.b.c' would be ignored!
@amirziai

amirziai commented Oct 5, 2019

Copy link
Copy Markdown
Owner

thanks for the PR @sudor , do you mind writing a test to show the intended behavior?

Comment thread flatten_json.py
for i, item in enumerate(list_keys):
if i != len(list_keys) - 1:
if not list_keys[i + 1].startswith(list_keys[i]):
if not list_keys[i + 1].startswith(list_keys[i]+'.'):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only accounts when separator=.. I think it should be if not list_keys[i + 1].startswith(list_keys[i]+separator):

@amirziai amirziai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a test to show the intended behavior

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

Successfully merging this pull request may close these issues.

3 participants