Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add title retrieval to Notion crawler #765

Merged
merged 20 commits into from
Jan 31, 2024

Conversation

rishimo
Copy link
Contributor

@rishimo rishimo commented Jan 24, 2024

🤔 Why?

SC24068

The NotionReader loader from LlamaHub doesn't include functionality to get a page's title, which is useful in generating embeddings and also when returning search results and generated results to users.

🤓 What?

Adds a method to the Notion extractor to retrieve a page's title from the Notion API. The extractor now stores the page title in the document metadata for use later.

Also modifies map_metadata to prepend the Title to all text nodes.

Also includes a couple other fixes (setting _description, _platform, adjusting configuration information).

🧪 Tested?

Unit tests were updated accordingly and ran successfully. Also verified end-to-end with ingestion.

☑️ Checks

  • My PR contains actual code changes, and I have updated the version number in pyproject.toml.

Copy link

This pull request has been linked to Shortcut Story #24068: Add title to NotionExtractor.

@rishimo rishimo marked this pull request as ready for review January 24, 2024 18:35
@rishimo rishimo requested a review from prith189 January 24, 2024 18:36
Copy link

github-actions bot commented Jan 24, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
15758 14544 92% 85% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
metaphor/common/embeddings.py 81% 🟢
metaphor/notion/config.py 100% 🟢
metaphor/notion/extractor.py 97% 🟢
TOTAL 93% 🟢

updated for commit: 34bc17b by action🐍

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ca4386a) 92.07% compared to head (34bc17b) 92.29%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #765      +/-   ##
==========================================
+ Coverage   92.07%   92.29%   +0.22%     
==========================================
  Files         194      154      -40     
  Lines       15899    15758     -141     
==========================================
- Hits        14639    14544      -95     
+ Misses       1260     1214      -46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rishimo rishimo requested a review from prith189 January 29, 2024 20:25
Copy link

@prith189 prith189 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rishimo rishimo merged commit 568318a into main Jan 31, 2024
6 checks passed
@rishimo rishimo deleted the rishimohan/sc-24068/add-title-notion branch January 31, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants