Spaces:
Runtime error
Runtime error
marondeau
commited on
Removed leftover and fixed docstring
Browse files
buster/documents/sqlite/documents.py
CHANGED
|
@@ -34,7 +34,7 @@ class DocumentsDB(DocumentsManager):
|
|
| 34 |
|
| 35 |
Example:
|
| 36 |
>>> db = DocumentsDB("/path/to/the/db.db")
|
| 37 |
-
>>> db.
|
| 38 |
>>> df = db.get_documents("source")
|
| 39 |
"""
|
| 40 |
|
|
@@ -150,7 +150,6 @@ class DocumentsDB(DocumentsManager):
|
|
| 150 |
# Execute the SQL statement and fetch the results
|
| 151 |
results = self.conn.execute("SELECT * FROM documents WHERE source = ?", (source,))
|
| 152 |
rows = results.fetchall()
|
| 153 |
-
print(rows[0])
|
| 154 |
|
| 155 |
# Convert the results to a pandas DataFrame
|
| 156 |
df = pd.DataFrame(rows, columns=[description[0] for description in results.description])
|
|
|
|
| 34 |
|
| 35 |
Example:
|
| 36 |
>>> db = DocumentsDB("/path/to/the/db.db")
|
| 37 |
+
>>> db.add("source", df) # df is a DataFrame containing the documents from a given source, obtained e.g. by using buster.docparser.generate_embeddings
|
| 38 |
>>> df = db.get_documents("source")
|
| 39 |
"""
|
| 40 |
|
|
|
|
| 150 |
# Execute the SQL statement and fetch the results
|
| 151 |
results = self.conn.execute("SELECT * FROM documents WHERE source = ?", (source,))
|
| 152 |
rows = results.fetchall()
|
|
|
|
| 153 |
|
| 154 |
# Convert the results to a pandas DataFrame
|
| 155 |
df = pd.DataFrame(rows, columns=[description[0] for description in results.description])
|