Spaces:
Runtime error
Runtime error
add check file exists (#60)
Browse files
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]
|