Project

General

Profile

Bug #1688

KeyError in kp_variant_log

Added by Nandini Bansal about 3 years ago. Updated almost 3 years ago.

Status:
In Progress
Priority:
Normal
Target version:
Start date:
09/30/2021
Due date:
% Done:

90%

Estimated time:
4.00 h

Description

kp_variant_log is a dictionary that keeps track of the variant with which the KP was linked/tagged. The key of the dictionary follows the format of KP"#"+doc_id+"#"+depth. The dictionary lookup is done to add subsection header info to the annotated file at the time of tagging.
E.g.

math.sqrt(-1) BR2PPPP 328 ^&* math.sqrt ^&* 1.0

In the similar-doc string "328 ^&* math.sqrt ^&* 1.0", "math.sqrt" was fetched and added after look-up in the dictionary kp_variant_log. This information is added to the annotated file so that KP can be directly linked to the linked/similar subsection instead of the beginning of the document.
However, we have been a lot of KeyError hits in the log for the lookup in kp_variant_log. The KeyErrors are logged in the main.log file. We need to investigate and fix this error.

Intuition to solve it
1) Check if the header variant is actually present in the given doc_id or not,
2) Check if the depth value of the header variant is correct or not.

For (2), -1 is the header depth for subsections. Otherwise document header.

Screenshot of the Error added in attachments.

For testing, please use C-API & Library Reference


Files

#1

Updated by Nandini Bansal about 3 years ago

  • Assignee set to Rohit Choudhary
  • Estimated time changed from 5.00 h to 4.00 h
#2

Updated by Rohit Choudhary about 3 years ago

  • Status changed from New to In Progress
#3

Updated by Nandini Bansal almost 3 years ago

  • Assignee changed from Rohit Choudhary to Nandini Bansal
  • % Done changed from 0 to 90

Also available in: Atom PDF