Skip to content

Commit e1d6932

Browse files
committed
test: add limiting
1 parent e5d7524 commit e1d6932

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

dlt_source_notion/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __get_id(obj):
2929
parallelized=True,
3030
primary_key="id",
3131
)
32-
def users() -> Iterable[TDataItem]:
32+
def list_users() -> Iterable[TDataItem]:
3333

3434
notion = get_notion_client()
3535

@@ -71,7 +71,12 @@ def split_user(user: Dict):
7171

7272

7373
@dlt.source(name="notion")
74-
def source() -> Sequence[DltResource]:
74+
def source(
75+
limit: int = -1,
76+
) -> Sequence[DltResource]:
77+
users = list_users()
78+
if limit != -1:
79+
users.add_limit(limit)
7580

7681
return users | split_user
7782

notion_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def load_notion_data() -> None:
99
pipeline_name="notion_pipeline", destination="duckdb", dev_mode=DEV_MODE
1010
)
1111
data = source(
12-
# limit=-1 if not DEV_MODE else 1,
12+
limit=-1 if not DEV_MODE else 1,
1313
)
1414
info = pipeline.run(
1515
data,

0 commit comments

Comments
 (0)