hbertrand commited on
Commit
1571e29
1 Parent(s): 8e27251

add check file exists (#60)

Browse files
Files changed (1) hide show
  1. buster/documents/pickle.py +3 -0
buster/documents/pickle.py CHANGED
@@ -29,6 +29,9 @@ class DocumentsPickle(DocumentsManager):
29
  self.documents.to_pickle(self.filepath)
30
 
31
  def get_documents(self, source: str) -> pd.DataFrame:
 
 
 
32
  documents = self.documents.copy()
33
  if "current" in documents.columns:
34
  documents = documents[documents.current == 1]
29
  self.documents.to_pickle(self.filepath)
30
 
31
  def get_documents(self, source: str) -> pd.DataFrame:
32
+ if self.documents is None:
33
+ raise FileNotFoundError(f"No documents found at {self.filepath}. Are you sure this is the correct path?")
34
+
35
  documents = self.documents.copy()
36
  if "current" in documents.columns:
37
  documents = documents[documents.current == 1]