17
17
Database ,
18
18
Page ,
19
19
PageProperty ,
20
- # TODO: replace this with `BaseDatabaseProperty` when https://github.com/stevieflyer/pydantic-api-models-notion/pull/8 lands
21
- DatabaseProperty as BaseDatabaseProperty ,
22
- # MultiSelectPropertyConfig,
23
- # SelectPropertyConfig,
20
+ BaseDatabaseProperty ,
21
+ MultiSelectPropertyConfig ,
22
+ SelectPropertyConfig ,
24
23
)
25
24
from dlt .common .normalizers .naming .snake_case import NamingConvention
26
25
@@ -199,10 +198,7 @@ def database_resource(
199
198
if p .type not in ["multi_select" , "select" ]:
200
199
continue
201
200
202
- # data: MultiSelectPropertyConfig | SelectPropertyConfig = getattr(p, p.type)
203
- data = getattr (p , p .type )
204
- if data is None :
205
- continue
201
+ data : MultiSelectPropertyConfig | SelectPropertyConfig = getattr (p , p .type )
206
202
for option in data .options :
207
203
yield dlt .mark .with_hints (
208
204
item = use_id (option , exclude = ["object" , "color" ]),
@@ -228,10 +224,7 @@ def database_resource(
228
224
229
225
row = {}
230
226
for selected_key in selected_properties :
231
- prop_raw = page .properties [selected_key ]
232
- # TODO: remove this cast, once https://github.com/stevieflyer/pydantic-api-models-notion/pull/6 lands
233
- prop : PageProperty = page_property_adapter .validate_python (prop_raw )
234
-
227
+ prop = page .properties [selected_key ]
235
228
target_key = target_key_mapping [selected_key ]
236
229
237
230
match prop .type :
0 commit comments