DEpt-metagenom / MetagenoMongo

1 stars 2 forks source link

Rework the Excel "import" function #3

Closed haalasz closed 1 month ago

haalasz commented 3 months ago

NoneType errors, datetime library is not imported, empty cells are filled with None.

albertbokor-unideb commented 3 months ago

when importing via Import File in UI, this example file produces 4 more records filled with None [Edit:] fixed here

Also (i think) fixed datetime, just needed to be imported apparently.

albertbokor-unideb commented 3 months ago

empty cells are filled with None

how do we want it to behave instead?

haalasz commented 3 months ago

empty cells are filled with None

how do we want it to behave instead?

If the cell is empty in the xlsx file, it must remain empty after import.

albertbokor-unideb commented 3 months ago

TODO: handling excel column name mismatch (not to import but error out) csv import works fine (name mismatch popup appears, select select deired column name) but xlsx crashes it out

haalasz commented 3 months ago

After importing xlsx with wrong column name (not matching the .metagenomongo.csv) it gives this error message after clicking the popup to fix the wrong name (based on difflib):

/home/haalasz/anaconda3/lib/python3.11/site-packages/openpyxl/reader/excel.py:228: UserWarning: Data Validation extension is not supported and will be removed
  ws_parser.bind_all()
Traceback (most recent call last):
  File "/home/haalasz/github/metagenom/MetagenoMongo/metagenomongo.py", line 267, in <module>
    if cell_value.strip():
       ^^^^^^^^^^^^^^^^
AttributeError: 'datetime.datetime' object has no attribute 'strip'
albertbokor-unideb commented 3 months ago

TODO: see if i can find a good existing xlsx to csv tool that can be imported to execute before excel import [SOLVED]: made pandas handle all file importing and exporting

TODO EXTRA: popup to veriyf/select table from excel file [CLUE:] pandas lets you specify sheet on xlsx import

albertbokor-unideb commented 3 months ago

If the cell is empty in the xlsx file, it must remain empty after import.

added conversion for this on each place it imports file

gpetho commented 2 months ago

I've just noticed that there's a draft pull request on this repo that is related to this issue. What is the status of that pull request? Is it something that should be merged into the main branch?

haalasz commented 2 months ago

I've commented on the pull request that the excel import fix messed up the GUI. It is fixed now and the working app is called mtgnmng.py to avoid the accidental merge. The xlsx fix branch should not be merged with the main.

gpetho commented 2 months ago

Thank you, I have closed the pull request as rejected.