Closed luo-bing closed 3 weeks ago
Before running the second part of the code, I found that there was no database named "gdelt_chatgpt" in the project. After running the code, an empty database named "gdelt_chatgpt" was created. Then an error occurred: "argument of type 'NoneType' is not iterable." This is because init_db read the empty data from "gdelt_chatgpt" and attempted to iterate over it in the following code: if str(idx) in init_db and str(rel_or_obj) in init_db[str(idx)]. I'm wondering if this situation is normal, or how should I resolve it?
I read an empty dictionary from the dictdatabase database named 'gdelt_chatgpt'. How can I resolve this issue?我从名为 'gdelt_chatgpt' 的 dictdatabase 数据库中读取到了一个空字典,我该如何解决这个问题?