Skip to content

Opaque error when data sources is missing a column #46

@jakebeal

Description

@jakebeal

When the "data sources" tab is missing a column (e.g., column G on old versions of the sheet), it exceptions with an opaque error:

>>> doc = es.excel_to_sbol(wb)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python39\site-packages\sbol_utilities\excel_to_sbol.py", line 426, in excel_to_sbol
    basic_parts, composite_parts, linear_products, final_products, source_table = read_metadata(wb, doc, config)
  File "C:\Python39\site-packages\sbol_utilities\excel_to_sbol.py", line 110, in read_metadata
    source_table = {row[config['source_name_col']].value: row[config['source_uri_col']].value
  File "C:\Python39\site-packages\sbol_utilities\excel_to_sbol.py", line 112, in <dictcomp>
    if row[config['source_literal_col']].value}
IndexError: tuple index out of range

It should at least be more graceful about its crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions