-
Notifications
You must be signed in to change notification settings - Fork 474
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
Fix query handling and example format in response to Notion changes #95
Conversation
👏 Awesome work @jamalex. I tried out the branch for #96 (which includes this PR) and this does indeed fix the issue with specifying filters to match that of the new format. I did notice that my
I dug around and started inspecting the returned structure from Notion: def default_query(self):
+ print(self.get().keys())
return self.build_query(**self.get("query", {})) And saw the following surprise:
Then I checked what I got with my original
I applied the following change and things started working as expected: def default_query(self):
- return self.build_query(**self.get("query", {}))
+ return self.build_query(**self.get("query2", {})) TL;DR It seems with their API change, they phased out |
@jamalex as said Notion added some more changes it seems to the API. I tried going do the road @kevinjalbert suggested, but that openend a can of worms with |
If it's likely that jamalex#95 will go unmerged for a while, it's worthwhile giving new adopters a heads-up.
My own fork of notion-py incorporate: - jamalex/notion-py#96 - jamalex/notion-py#95 - some small modifications that took the PRs to the finish line for me This ends up fixing the broken issues with the recent issues: - jamalex/notion-py#92 - jamalex/notion-py#94 I am able to remove some of the 'hack' code I put in recently. The filter_params for queries had to be reworked to match the new format.
It looks as if they renamed "query2" back to "query", so this works again. :) I've merged and and will continue doing further testing (and merging of subsequent PRs) on it before releasing. |
My own fork of notion-py incorporate: - jamalex/notion-py#96 - jamalex/notion-py#95 - some small modifications that took the PRs to the finish line for me This ends up fixing the broken issues with the recent issues: - jamalex/notion-py#92 - jamalex/notion-py#94 I am able to remove some of the 'hack' code I put in recently. The filter_params for queries had to be reworked to match the new format.
On Jan 9, Notion made changes to the API format for queries. This PR allows the new query format to be used, but manually constructed queries will need to be updated. See #94.