Skip to content

Commit

Permalink
cover case of pos_in_doc being 0
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas committed Jan 31, 2024
1 parent 353e845 commit 206e1a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepsearch/cps/queries/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SearchResultItem(BaseModel):
def patch_pos(cls, values):
path_in_doc = values.get("path_in_doc")
pos_in_doc = values.get("pos_in_doc")
if pos_in_doc and isinstance(pos_in_doc, int) and not path_in_doc:
if pos_in_doc is not None and isinstance(pos_in_doc, int) and not path_in_doc:
values["path_in_doc"] = f"main-text.{pos_in_doc}"
return values

Expand Down

0 comments on commit 206e1a1

Please sign in to comment.