yarmand / ragyva

my personal take on RAG to manage my personal notes
Apache License 2.0
0 stars 1 forks source link

Improve logging - Error on first import #12

Open sarmad-abualkaz opened 1 month ago

sarmad-abualkaz commented 1 month ago

I ran the command find ./docs -name '*.md' | ./import.py

The output was:

Import filenames from stdin stdin
Error occurred: Table doc_model does not exist.Please first call db.create_table(doc_model, data). Creating table doc_model.
with 1 chunks 
.

I feel like this can be probably logged as a Warning instead - as this gives the impression the import had failed when in fact it created the table later.

Let me know what you thinlk.

yarmand commented 1 month ago

yes, this exception handling here is pretty poor. I didn't get a chance to look into the type of exception lanceDB returns in the case of non existing table. Proper way to do it would probably be to catch the exception when the table does not exist and log a warning. And log an error for all other exceptions.

Also my logs are REALLY poor. I'm still learning python and didn't spent the time yet to select a proper loging library.

I'd love if you could take care of this 2 things in 2 PRs ;)