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

Feeding tables with fewer columns than expected to importer tracebacks #2333

Closed
soininen opened this issue Sep 27, 2023 · 0 comments
Closed
Assignees
Labels
bug Something isn't working Data import/export
Milestone

Comments

@soininen
Copy link
Contributor

I had an Importer specification that expected to process a five-column csv table but then I changed the file's layout to contain only four column. Trying to import the file then resulted in Importer hanging for eternity and this Traceback:

Traceback (most recent call last):
  File "lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "spine_engine\utils\returning_process.py", line 50, in run
    return_value = self._target(self, *self._args, **self._kwargs)
  File "spine-items\spine_items\importer\do_work.py", line 64, in do_work
    data, errors = connector.get_mapped_data(
  File "spinedb_api\spine_io\importers\reader.py", line 142, in get_mapped_data
    data, t_errors = get_mapped_data(
  File "spinedb_api\import_mapping\generator.py", line 108, in get_mapped_data
    mapping.import_row(row, read_state, mapped_data)
  File "spinedb_api\import_mapping\import_mapping.py", line 264, in import_row
    self.child.import_row(source_row, state, mapped_data, errors=errors)
  File "spinedb_api\import_mapping\import_mapping.py", line 264, in import_row
    self.child.import_row(source_row, state, mapped_data, errors=errors)
  File "spinedb_api\import_mapping\import_mapping.py", line 264, in import_row
    self.child.import_row(source_row, state, mapped_data, errors=errors)
  [Previous line repeated 3 more times]
  File "spinedb_api\import_mapping\import_mapping.py", line 246, in import_row
    source_data = self._data(source_row)
  File "spinedb_api\import_mapping\import_mapping.py", line 269, in _data
    return source_row[self.position]
IndexError: list index out of range

This happened in master but we need to check if the bug is still present in 0.8 branch.

@soininen soininen added bug Something isn't working Data import/export labels Sep 27, 2023
@soininen soininen added this to the v0.8.0 milestone Sep 27, 2023
@PiispaH PiispaH self-assigned this Sep 28, 2023
PiispaH added a commit to spine-tools/Spine-Database-API that referenced this issue Oct 5, 2023
Now when an importer spec is modified to have a column
reference that is out of range for the source data, an
error is shown. If such importer spec is executed an
error will also be thrown and logged.

Re spine-tools/Spine-Toolbox#2333
PiispaH added a commit to spine-tools/spine-items that referenced this issue Oct 5, 2023
Now when an importer spec is modified to have a column
reference that is out of range for the source data, an
error is shown. If such importer spec is executed an
error will also be thrown and logged.

Re spine-tools/Spine-Toolbox#2333
PiispaH added a commit to spine-tools/spine-items that referenced this issue Oct 5, 2023
Now when an importer spec is modified to have a column
reference that is out of range for the source data, an
error is shown. If such importer spec is executed an
error will also be thrown and logged.

Re spine-tools/Spine-Toolbox#2333
PiispaH added a commit to spine-tools/Spine-Database-API that referenced this issue Oct 5, 2023
Now when an importer spec is modified to have a column
reference that is out of range for the source data, an
error is shown. If such importer spec is executed an
error will also be thrown and logged.

Re spine-tools/Spine-Toolbox#2333
@PiispaH PiispaH closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Data import/export
Projects
None yet
Development

No branches or pull requests

2 participants