Skip to content
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

KeyError: 'status' #35

Open
GianniDmc opened this issue Sep 25, 2023 · 0 comments
Open

KeyError: 'status' #35

GianniDmc opened this issue Sep 25, 2023 · 0 comments

Comments

@GianniDmc
Copy link

GianniDmc commented Sep 25, 2023

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant