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

adjusted fixed query limits #293

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notion/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def search_pages_with_parent(self, parent_id, search=""):
data = {
"query": search,
"parentId": parent_id,
"limit": 10000,
"limit": 100,
Copy link

Choose a reason for hiding this comment

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

I think it'd be better to store this as a constant somewhere. So if it changes later, there's only 1 place to update. Thoughts?

Copy link

@flaneur2020 flaneur2020 Aug 7, 2021

Choose a reason for hiding this comment

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

maybe it could be an argument in NotionClient.__init__() ?

"spaceId": self.current_space.id,
}
response = self.post("searchPagesWithParent", data).json()
Expand Down
4 changes: 2 additions & 2 deletions notion/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def call_load_page_chunk(self, page_id):

data = {
"pageId": page_id,
"limit": 100000,
"limit": 100,
"cursor": {"stack": []},
"chunkNumber": 0,
"verticalColumns": False,
Expand Down Expand Up @@ -326,7 +326,7 @@ def call_query_collection(
"collectionId": collection_id,
"collectionViewId": collection_view_id,
"loader": {
"limit": 10000,
"limit": 1000000,
"loadContentCover": True,
"searchQuery": search,
"userLocale": "en",
Expand Down