jamalex / jamalex/notion-py

API for "search" in collection querying must have changed at some point

Open
#110 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.4k
Forks
470
PR merge metrics
No merged PRs in 30d

Description

Trying to replicate the example in the README.md, I found that listing records of a collection with a search criteria is no longer working. Specifically, the following code returns all records, rather than just the ones containing "Bob":

`for row in cv.collection.get_rows(search="Bob"):
print("We estimate the value of '{}' at {}".format(row.name, row.estimated_value))`

Digging through requests in Chrome I found that the parameter name for a search query has changed from "query" to "searchQuery". I can fix this manually by changing line 325 in store.py: https://github.com/jamalex/notion-py/blob/56b7a904474619cf60c4768db435c921ca18f44f/notion/store.py#L325
to
`"searchQuery": search,`

I hope I have provided enough information for a fix. Thanks for the great work making a notion API available in Python!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the README.md collection-query example and inspect line 325 of store.py, where the search parameter is assembled. Reproduce the example with search="Bob" and verify that the request uses the parameter identified in the issue and returns only matching records.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.