Dage 18: Persistent Storage JSON#179
Conversation
| self._query: str = query | ||
| self._doc_id_to_rating_score: Dict[str, int] = {doc_id: self.DOC_NOT_RATED} | ||
| self._doc_id_to_rating_score: Dict[str, int] = {} | ||
| # HANDLING NONEs - thowed error in some tests |
There was a problem hiding this comment.
Thanks for the spot! Comming in the next commit
There was a problem hiding this comment.
Please resolve when you commit the change.
There was a problem hiding this comment.
Update: this should be solved
|
I approved this, but please make changes on the things mentioned and feel free to resolve the conversations once you update . |
|
@dantuzi should make more sense in general now |
| "query_text": query.get_query(), | ||
| "doc_ids": query.get_doc_ids(), | ||
| "doc_ratings": query._doc_id_to_rating_score.copy(), # copy to avoid mutation | ||
| "documents": [doc.model_dump() for doc in documents if doc is not None] |
There was a problem hiding this comment.
what does model_dump() do?
There was a problem hiding this comment.
Doc it's a Pydantic model. model_dump it's the internal fn to serialize (to dict / json)
90cb945 to
49b531f
Compare
feat: datastore: JSON persistence + QueryContext API cleanupAdded on-disk persistence ( Included
|
| return path | ||
|
|
||
|
|
||
| def test_add_and_get_document(empty_store): |
There was a problem hiding this comment.
can we use the naming convention test_expect
There was a problem hiding this comment.
Added naming conventions
…eryRatingContext- polishing and refining datastore save/load
…o add fixtures / mocks, and unify the test naming
…ontext_query - changed the internal name in QueryRatingContext: from get_query() to get_query_text()
bc5c5ac to
e01a5f3
Compare
e01a5f3 to
e1c3d56
Compare
TASK TICKET
DAGE-18 - Includes a mini-research on mocks vs real I/O for files).
Changes
/tests/unit/test_data_store.py