lolipopshock / notion-df

Seamlessly Connecting Notion Database with Python Pandas DataFrame
MIT License
84 stars 14 forks source link

KeyError: 'status' #35

Open GianniDmc opened 1 year ago

GianniDmc commented 1 year ago

Hello,

New to this library and very interested!

Trying to import my database into pandas but got a KeyError: 'status' error. It seems that the status type property is not supported? Is there any workaround to avoid this?

Regards

Here is the full error log :

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/_pandas.py in read_notion(notion_url, nrows, resolve_relation_values, errors, api_key) 37 pd.DataFrame: the loaded dataframe. 38 """ ---> 39 return download( 40 notion_url, 41 nrows=nrows,

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/agent.py in wrapper(*args, *kwargs) 52 api_key = _load_api_key(kwargs.pop("api_key", None)) 53 client = Client(auth=api_key) ---> 54 out = func(client=client, args, **kwargs) 55 56 if orig_client is None:

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/agent.py in download(notion_url, nrows, resolve_relation_values, errors, api_key, client) 195 client: Client = None, 196 ): --> 197 df = download_df_from_database( 198 notion_url=notion_url, 199 nrows=nrows,

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/agent.py in download_df_from_database(notion_url, client, nrows, errors) 138 try: 139 retrieve_results = client.databases.retrieve(database_id=database_id) --> 140 schema = DatabaseSchema.from_raw(retrieve_results["properties"]) 141 except HTTPStatusError: 142 error_msg = (

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/configs.py in from_raw(cls, configs) 298 def from_raw(cls, configs: Dict) -> "DatabaseSchema": 299 --> 300 configs = {key: parse_single_config(config) for key, config in configs.items()} 301 return cls(configs) 302

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/configs.py in (.0) 298 def from_raw(cls, configs: Dict) -> "DatabaseSchema": 299 --> 300 configs = {key: parse_single_config(config) for key, config in configs.items()} 301 return cls(configs) 302

~/anaconda3/envs/py39_env/lib/python3.9/site-packages/notion_df/configs.py in parse_single_config(data) 230 231 def parse_single_config(data: Dict) -> BasePropertyConfig: --> 232 return parse_obj_as(CONFIGS_MAPPING[data["type"]], data) 233 234

KeyError: 'status'