Skip to content

Fix "TSV" generation #67

@CBalsier

Description

@CBalsier

When exporting data by clicking on "download the set as a .tsv file", the resulting file presents shifted columns when data is not present. See for example in the following screenshots : export from the dataset Apriles-ODAS and "preview" from OpenScraper:

  • in the preview, there is no "date" and no "données économiques", the columns are blank
  • in the TSV,
    • the "date" contains "partenaires" (the column right after date), one shift to the left,
    • the "partenaires" contains "résumé" (if there is no "données économiques") or "données économiques", one or two shifts to the left
    • "données économiques" contains "tags" or "résumé", one or two shifts since no other empty column is between them
    • "résumé" contains "tags" or "website" (which, in fact, also contains e-mails…)
    • "tags" contains "website" or "adresse"

Screenshot from 2019-05-03 17-27-56
Screenshot from 2019-05-03 17-28-24

Suggested fix : a little bit like in

item_list.append(item["link_data"] if "link_data" in item.keys() else '')
replace line 1367-1368

if id_field in item.keys() :
    item_list.append( " ".join(item[ id_field ]) )

by

if id_field in item.keys() :
    item_list.append( " ".join(item[ id_field ]) )
else :
    item_list.append("")

to ensure empty values are correctly written at line 1369 in the resulting file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions