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

Data is lost if unflatten column name begins with name #62

Open
jessicamrbr opened this issue Jan 24, 2020 · 2 comments
Open

Data is lost if unflatten column name begins with name #62

jessicamrbr opened this issue Jan 24, 2020 · 2 comments

Comments

@jessicamrbr
Copy link

jessicamrbr commented Jan 24, 2020

import flatten_json

records = {
    'lives.name':'person',
    'lives.name_mother':'mother'
}

flatten_json.unflatten(records, ".")

expected:

{
   'lives': {
      'name': 'person',
      'name_mother': 'mother'
   }
}

but result in:

{
   'lives': {
      'name_mother': 'mother'
   }
}
@nhoclove
Copy link

nhoclove commented Aug 4, 2020

I faced the same issue. Here is my simple test:

dic = {
    'a': 1,
    'ab': 2,
}

unflatten(dic)

Expected:
{ "a": 1, "ab": 2 }
Actual:
{ "ab": 2 }

@satyajitovelil
Copy link

Solved as of flatten_json==0.1.8. But you probably have version 0.1.7 installed from pypi. Refer to #65 ; #65 (comment).

@aodj aodj mentioned this issue Oct 15, 2020
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

3 participants