Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = basic-notion
version = 0.6.2
version = 0.6.3
author = Grigory Statsenko
author_email = grisha100@gmail.com
description = Client-agnostic model wrapper for Notion API
Expand Down
17 changes: 9 additions & 8 deletions src/basic_notion/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ def make_spec(self) -> dict[str, dict]:


def load_schema_from_dict(raw_data: dict) -> Schema:
data = {
name: get_property_schema_cls(prop_data['type'])(
property_name=name,
data=prop_data,
)
for name, prop_data in raw_data.items()
if 'type' in prop_data
}
data = {}
for name, prop_data in raw_data.items():
if 'type' in prop_data:
try:
data[name] = get_property_schema_cls(prop_data['type'])(
property_name=name,
data=prop_data, )
except KeyError:
pass
return Schema(properties=data)