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

Fix "TSV" generation #67

Open
CBalsier opened this issue May 3, 2019 · 0 comments
Open

Fix "TSV" generation #67

CBalsier opened this issue May 3, 2019 · 0 comments

Comments

@CBalsier
Copy link

CBalsier commented May 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant