DEpt-metagenom / MetagenoMongo

1 stars 2 forks source link

Import file not working #17

Closed gpetho closed 2 months ago

gpetho commented 2 months ago

When I browse the sample test file from the original task issue and click the "Import file" button, nothing happens, the table containing the data in the csv file is not displayed.

gpetho commented 2 months ago

@iwmstjp , please check this, the application should be in a testable state on Wednesday.

gpetho commented 2 months ago

After copying the .metagenomongo.csv to flask-version/metagenomongo the fields are now displayed in the top line of the application, but the import file button still does nothing. After I browse test_dept_sample_db.csv from my computer and click on the button, nothing happens. The lines of the table are not displayed, and there is no error message.

iwmstjp commented 2 months ago

Could you run the app in the MetagenoMongo directory? The run command will be python flask-version/metagenomongo/app.py I added the error handling for FileNotFoundError to the latest version.

gpetho commented 2 months ago

When I do that, I get a different error, which is (kind of as expected)

FileNotFoundError: [Errno 2] No such file or directory: 'uploads\\test_dept_sample_db.csv'

The root directory of the repository doesn't have an uploads subdirectory, which makes sense, that subdirectory belongs to the Flask application.

iwmstjp commented 2 months ago

Thank you for your reply. I added uploads directory in the root directory.

gpetho commented 2 months ago

I added uploads directory in the root directory.

Right, that's obviously a workaround, but we don't want to do that. As I said, that subdirectory belongs to the Flask application, it has no business being in the root directory of the repository. Just to test what happens if I create an uploads directory in the root directory, I created one on my machine now, it doesn't change anything. Obviously the FileNotFoundError disappears, but the behavior doesn't change. The name of the selected file disappears and changes back to "No file selected.", the table is still empty, there is no error message or anything in the terminal.

iwmstjp commented 2 months ago

sample.csv Could you try importing this file?

gpetho commented 2 months ago

That seems to work, it import this:

image

iwmstjp commented 2 months ago

Could you share your previous file which can not be imported?

gpetho commented 2 months ago

test_dept_sample_db.csv

iwmstjp commented 2 months ago

This issue was resolved by the following commits: fix: add error message to index.html chore: add README.md fix: add error handling for FileNotFoundError