ome / omero-parade

OMERO.web plugin for displaying Dataset thumbnails or Plates in webclient center panel
GNU Affero General Public License v3.0
1 stars 12 forks source link

Ignore #header row for csv tables #90

Open will-moore opened 2 years ago

will-moore commented 2 years ago

Just got a bug report from a user trying to use OMERO.parade on a Dataset at https://demo.openmicroscopy.org/webclient/?show=dataset-6308 This bug report was actually due to the user trying to filter using a csv that had the #header for populate script, so that the column names are not read correctly and therefore the first value added at

column_data[name].append(value.strip())

is the actual column name, so that all columns contain at least 1 string. So this fails:

            # try to convert to number (if not empty string)
            values = [float(v) if len(v) > 0 else v for v in values]

and we get this exception:

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero_parade/views.py" in filter_script
  128.                 return module.get_script(request, filter_name, conn)

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero_parade/csv_filters/omero_filters.py" in get_script
  194.                       'default': table_cols[0],

Exception Type: IndexError at /parade/filters/script/metadata.csv/
Exception Value: list index out of range