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

Enhance Notion reader to list databases from workplace and pages for … #14488

Merged

Conversation

sagarjadhavcalsoft
Copy link
Contributor

@sagarjadhavcalsoft sagarjadhavcalsoft commented Jul 1, 2024

Description

Enhanced Notion reader with methods to list databases and pages, added retry mechanism for API requests, and improved logging for better debugging.

New Features

  1. Request with Retry Mechanism: Added _request_with_retry method for retrying requests and handling rate limits.
  2. List Databases: Added list_databases method to list all databases in the Notion workspace.

Modifications

  1. _read_block Method: Now uses _request_with_retry for API requests.
  2. query_database Method: Updated to use _request_with_retry and handle pagination.
  3. search Method: Updated to use _request_with_retry and handle pagination.
  4. load_data Method: Now supports loading from multiple databases via a list of database_ids.

Bug Fixes

  1. Rate Limit Handling: Improved error handling with exponential backoff in _request_with_retry.
  2. Pagination Handling: Fixed issues in query_database and search methods for better pagination handling.

Example Usage

  1. Main Block: Added examples for listing databases within a workplace.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sagarjadhavcalsoft sagarjadhavcalsoft marked this pull request as ready for review July 1, 2024 12:11
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 1, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 1, 2024
@logan-markewich logan-markewich enabled auto-merge (squash) July 1, 2024 16:01
@logan-markewich logan-markewich merged commit 58d5f23 into run-llama:main Jul 1, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants