-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Description
I'm getting a 500 Server Error for code that used to work.
It can be reproduced with the following:
from notion.client import NotionClient
from dotenv import load_dotenv
import os
from notion.logger import set_log_level
set_log_level("DEBUG")
load_dotenv()
client = NotionClient(token_v2=os.getenv("NOTION_TOKEN_A"))
collection = client.get_collection(os.getenv("NOTION_COLLECTION_ID"))
print(collection)
row = collection.add_row() # 500 server error
row.title = "just some data"The error:
Traceback (most recent call last):
File "/Users/mike/GitHub/underline/functions_py/addrowtest.py", line 13, in <module>
row = collection.add_row()
^^^^^^^^^^^^^^^^^^^^
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/notion/collection.py", line 205, in add_row
row_id = self._client.create_record("block", self, type="page")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/notion/client.py", line 383, in create_record
with self.as_atomic_transaction():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/notion/client.py", line 435, in __exit__
self.client.submit_transaction(operations)
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/notion/client.py", line 290, in submit_transaction
self.post("submitTransaction", data)
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/notion/client.py", line 265, in post
response.raise_for_status()
File "/Users/mike/GitHub/underline/.venv/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://www.notion.so/api/v3/submitTransaction
This is using the Jun 17 patch for space ids notion @ git+https://github.com/jamalex/notion-py.git@b3630b8c425fd217de5c08800ffc761474d4089b
philippkeller and unyacat
Metadata
Metadata
Assignees
Labels
No labels