Skip to content

Generalize-tsvs creating malformed enums causes crash #169

@amc-corey-cox

Description

@amc-corey-cox

Describe the bug
generalize-tsvs enum creation in some datasets causes exception crash in schema_as_dict due to enum type being string not dict.

To Reproduce
I'm not certain the specific details yet but my current data set causes the crash, I'm still hunting down the specific issue. A different data set does not have the issue.

Expected behavior
Create the schema without raising an exception and crashing.

Code snippets
This is where we're crashing.
obj = json_dumper.to_dict(schema)
if '@type' in obj:
del obj['@type']
obj['prefixes'] = {k: v['prefix_reference'] for k, v in obj.get('prefixes', {}).items()}
for k, v in obj.get('enums', {}).items():
for pv in v.get('permissible_values', {}).values():
del pv['text']

I'm going to try putting in a exception handler to give more information on what the data looks like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions