paperpile-notion icon indicating copy to clipboard operation
paperpile-notion copied to clipboard

KeyError: 'results'

Open qsimeon opened this issue 1 year ago • 0 comments

I ran the example in the README but with my (blank) database with the minimal properties (see screenshot) and my own API. Throws the IndexError. I added some print statements to lib/notion_utils.py which is what you see outputted.

python update_notion_db.py \ --input data.csv \ --config config.yaml \ --database xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ --token secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

prop: Methods prop_value: {'id': '?:C;', 'type': 'multi_select', 'multi_select': []} prop: Authors prop_value: {'id': 'GE[?', 'type': 'multi_select', 'multi_select': []} prop: Venues prop_value: {'id': 'Nx<@', 'type': 'multi_select', 'multi_select': []} prop: Categories prop_value: {'id': 'zdTT', 'type': 'multi_select', 'multi_select': []} prop: Title prop_value: {'id': 'title', 'type': 'title', 'title': []} field['title']: []

Traceback (most recent call last): File "/Users/quileesimeon/GitHub Repos/paperpile-notion/update_notion_db.py", line 92, in <module> main(args) File "/Users/quileesimeon/GitHub Repos/paperpile-notion/update_notion_db.py", line 55, in main notion.query_database() File "/Users/quileesimeon/GitHub Repos/paperpile-notion/lib/notion.py", line 18, in query_database self.pages = parse_db_content(self.db.result['results']) File "/Users/quileesimeon/GitHub Repos/paperpile-notion/lib/notion_utils.py", line 101, in parse_db_content new_page[prop] = get_field_content(prop_value) File "/Users/quileesimeon/GitHub Repos/paperpile-notion/lib/notion_utils.py", line 92, in get_field_content return get_field_content(field["title"][0]) IndexError: list index out of range

qsimeon avatar Feb 10 '23 05:02 qsimeon