notion-sdk-py
notion-sdk-py copied to clipboard
Error while running example "first_project"
When running the first_project example -- I got the following errors when attempting to filter by name:
httpx.HTTPStatusError: Client error '400 Bad Request'notion_client.errors.APIResponseError: body failed validation. Fix one:{it then went on to list all of the body.filter types I could have provided}
The error is somewhere around this line:
- https://github.com/ramnes/notion-sdk-py/blob/0058b8db15cf021f3118a74fb371892afbb8b998/examples/first_project/script.py#L59
According to the documentation on developers.notion.com -- the filter object currently does not accept text as a type filter -- only rich_text:
- https://developers.notion.com/reference/post-database-query-filter#the-filter-object
After changing the line to search with rich_text, I was able to see the expected results for my search-by-name in the inline database.
Yep, most likely a change on their side. Thanks for raising the issue, do you want to work on it? PR are always welcome. :)
@ramnes are you busy on other works? I also met this issue.
I am also very busy on other works, and it seems this is not a minor change. :(
If you need this fixed quickly, I'd recommend you to investigate the issue, as it's not in my plans at the moment. Happy to help in getting a PR merged though.
Also if @mccorkle is right, it's just a matter of replacing text by rich_text, as mentioned in the first comment. :)
yes, I just replaced that field, but not sure whether ok for all cases.
#232 should have fixed this :)