Skip to content

Commit ea97a02

Browse files
committed
wip(today's fortune): Eschew obfuscation.
1 parent 4da0028 commit ea97a02

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

dlt_source_notion/__init__.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
Database,
1818
Page,
1919
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,
2423
)
2524
from dlt.common.normalizers.naming.snake_case import NamingConvention
2625

@@ -199,10 +198,7 @@ def database_resource(
199198
if p.type not in ["multi_select", "select"]:
200199
continue
201200

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)
206202
for option in data.options:
207203
yield dlt.mark.with_hints(
208204
item=use_id(option, exclude=["object", "color"]),
@@ -228,10 +224,7 @@ def database_resource(
228224

229225
row = {}
230226
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]
235228
target_key = target_key_mapping[selected_key]
236229

237230
match prop.type:

0 commit comments

Comments
 (0)