Add file of each entry to entry dict in org_to_jsonl converter

- This will help filter query to org content type using file filter
- Do not explicitly specify items being extracted from json of each
  entry in text_search as all text search content types do not have
  file being set in jsonl converters
This commit is contained in:
Debanjum Singh Solanky
2022-09-05 01:57:17 +03:00
parent 7e083d3e96
commit 7606724dbc
3 changed files with 16 additions and 16 deletions

View File

@@ -21,10 +21,10 @@ def test_entry_with_empty_body_line_to_jsonl(tmp_path):
# Act
# Extract Entries from specified Org files
entries = extract_org_entries(org_files=[orgfile])
entries, entry_to_file_map = extract_org_entries(org_files=[orgfile])
# Process Each Entry from All Notes Files
jsonl_data = convert_org_entries_to_jsonl(entries)
jsonl_data = convert_org_entries_to_jsonl(entries, entry_to_file_map)
# Assert
assert is_none_or_empty(jsonl_data)
@@ -43,10 +43,10 @@ def test_entry_with_body_to_jsonl(tmp_path):
# Act
# Extract Entries from specified Org files
entries = extract_org_entries(org_files=[orgfile])
entries, entry_to_file_map = extract_org_entries(org_files=[orgfile])
# Process Each Entry from All Notes Files
jsonl_string = convert_org_entries_to_jsonl(entries)
jsonl_string = convert_org_entries_to_jsonl(entries, entry_to_file_map)
jsonl_data = [json.loads(json_string) for json_string in jsonl_string.splitlines()]
# Assert