You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
examples: the official-SDK Notion script exits 1 at a database search that Notion-Version 2025-09-03 refuses #1157
What you ran — the Notion script of the official-SDK examples, on main at 08f22dc0, with notion-client 3.1.0, which sends Notion-Version: 2025-09-03:
python examples/using-official-sdk/notion.py
What happened — it reads the page, its blocks and its comment, then exits 1 at the search that lists databases, notion.search(filter={"property": "object", "value": "database"}):
notion_client.errors.APIResponseError: body failed validation. Fix one:
body.filter.value should be `"page"` or `"data_source"`, instead was `"database"`.
body.filter.in_trash should be defined, instead was `undefined`.
That refusal is real Notion's, word for word. The same body sent to api.notion.com on 2026-10-30 (UTC):
Notion-Version
filter.value
api.notion.com
2025-09-03
database
400 validation_error, the message above
2025-09-03
data_source
200, three data_source objects, none with a data_sources member
2022-06-28
database
200, three database objects, none with a data_sources member
Backlot has answered this way since 348e139c, which is #880: the script exits 0 on its parent d424a269 and 1 on 348e139c. CI runs the Linear example and none of the Python ones, so no run caught it.
What you expected instead — exit 0, printing the database's row as the script did on d424a269: database 'Eng Tasks' → 1 row(s): and - Fix gateway 502s [In Progress].
Where you ran it — main at 08f22dc0, Python 3.14.4, macOS 27.0, uv sync --all-extras --locked, notion-client 3.1.0.
What a fix has to settle — the script changes, not Backlot. Changing the filter's value alone is not enough: the next line reads db["data_sources"][0]["id"], a member none of the search results in the table has. Searching for data_source and querying the first result by its own id, notion.data_sources.query(data_source_id=ds["id"]), exits 0 on main and prints data source 'Eng Tasks' → 1 row(s): with the same row. The comment above the search, # list databases via a type-filtered search, then query one for its rows, would name data sources.
@reyhaan07 go ahead. No need to wait for an assignment: open a PR against the latest main with Closes #1157 in its description, and the linked PR is what marks the issue as taken.
It still reproduces on main at 17daef4f with notion-client 3.1.0. With the change under What a fix has to settle (a data_source filter, notion.data_sources.query(data_source_id=ds["id"]), and the title read from ds), the script exits 0 there and prints data source 'Eng Tasks' → 1 row(s): and - Fix gateway 502s [In Progress]. A few things for the PR:
The change is examples/using-official-sdk/notion.py alone, the comment above the search included. Backlot's refusal is real Notion's (the table in the issue), so nothing under backlot/ changes.
No test or CI job runs this script, so the template's first checkbox can stay [ ] with that reason on the same line. Under Verification, show the script's output on main and on your branch.
For the title, one sentence on what the script does once it is merged, starting with this issue's examples: prefix (item 5 of Pull requests in CONTRIBUTING.md).
Activity
reyhaan07 commentedon Oct 30, 2026
I'd like to take this one.
nuriyoo commentedon Oct 31, 2026
@reyhaan07 go ahead. No need to wait for an assignment: open a PR against the latest
mainwithCloses #1157in its description, and the linked PR is what marks the issue as taken.It still reproduces on
mainat17daef4fwith notion-client 3.1.0. With the change under What a fix has to settle (adata_sourcefilter,notion.data_sources.query(data_source_id=ds["id"]), and the title read fromds), the script exits 0 there and printsdata source 'Eng Tasks' → 1 row(s):and- Fix gateway 502s [In Progress]. A few things for the PR:examples/using-official-sdk/notion.pyalone, the comment above the search included. Backlot's refusal is real Notion's (the table in the issue), so nothing underbacklot/changes.[ ]with that reason on the same line. Under Verification, show the script's output onmainand on your branch.examples:prefix (item 5 of Pull requests in CONTRIBUTING.md).examples: the official-SDK Notion script lists data sources, so it ex…