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

convert_dicts throws a TypeError with nested lists #85

Open
ialarmedalien opened this issue Aug 5, 2022 · 0 comments
Open

convert_dicts throws a TypeError with nested lists #85

ialarmedalien opened this issue Aug 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ialarmedalien
Copy link

Describe the bug

convert_dicts throws a TypeError with nested lists

To Reproduce

Create a file containing the following JSON data:

{
    "date-parts": [
        [
            2011,
            9,
            29
        ]
    ]
}

run schemauto generalize-json on the file

behold the stack trace:

Traceback (most recent call last):
  File "/Users/gwg/code/kbase/credit_engine/.venv/bin/schemauto", line 8, in <module>
    sys.exit(main())
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/schema_automator/cli.py", line 218, in generalize_json
    schema = ie.convert(input, format=format, **kwargs)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/schema_automator/generalizers/json_instance_generalizer.py", line 64, in convert
    schema = csv_engine.convert_dicts(rows_dict, cn, cn)
  File "/Users/gwg/code/kbase/credit_engine/.venv/lib/python3.10/site-packages/schema_automator/generalizers/csv_data_generalizer.py", line 349, in convert_dicts
    slot_values[k].update(vs)
TypeError: unhashable type: 'list'
@ialarmedalien ialarmedalien added the bug Something isn't working label Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant