Skip to content

Commit 862a203

Browse files
authored
refactor!: Change Dataset unwind parameter to accept list of strings (#1357)
1 parent 265bcfd commit 862a203

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/crawlee/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ class GetDataKwargs(TypedDict):
612612
omit: NotRequired[list[str]]
613613
"""Fields to exclude from each item."""
614614

615-
unwind: NotRequired[str]
615+
unwind: NotRequired[list[str]]
616616
"""Unwinds items by a specified array field, turning each element into a separate item."""
617617

618618
skip_empty: NotRequired[bool]

src/crawlee/storage_clients/_base/_dataset_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def get_data(
5858
desc: bool = False,
5959
fields: list[str] | None = None,
6060
omit: list[str] | None = None,
61-
unwind: str | None = None,
61+
unwind: list[str] | None = None,
6262
skip_empty: bool = False,
6363
skip_hidden: bool = False,
6464
flatten: list[str] | None = None,
@@ -79,7 +79,7 @@ async def iterate_items(
7979
desc: bool = False,
8080
fields: list[str] | None = None,
8181
omit: list[str] | None = None,
82-
unwind: str | None = None,
82+
unwind: list[str] | None = None,
8383
skip_empty: bool = False,
8484
skip_hidden: bool = False,
8585
) -> AsyncIterator[dict[str, Any]]:

src/crawlee/storage_clients/_file_system/_dataset_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async def get_data(
246246
desc: bool = False,
247247
fields: list[str] | None = None,
248248
omit: list[str] | None = None,
249-
unwind: str | None = None,
249+
unwind: list[str] | None = None,
250250
skip_empty: bool = False,
251251
skip_hidden: bool = False,
252252
flatten: list[str] | None = None,
@@ -345,7 +345,7 @@ async def iterate_items(
345345
desc: bool = False,
346346
fields: list[str] | None = None,
347347
omit: list[str] | None = None,
348-
unwind: str | None = None,
348+
unwind: list[str] | None = None,
349349
skip_empty: bool = False,
350350
skip_hidden: bool = False,
351351
) -> AsyncIterator[dict[str, Any]]:

src/crawlee/storage_clients/_memory/_dataset_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async def get_data(
129129
desc: bool = False,
130130
fields: list[str] | None = None,
131131
omit: list[str] | None = None,
132-
unwind: str | None = None,
132+
unwind: list[str] | None = None,
133133
skip_empty: bool = False,
134134
skip_hidden: bool = False,
135135
flatten: list[str] | None = None,
@@ -188,7 +188,7 @@ async def iterate_items(
188188
desc: bool = False,
189189
fields: list[str] | None = None,
190190
omit: list[str] | None = None,
191-
unwind: str | None = None,
191+
unwind: list[str] | None = None,
192192
skip_empty: bool = False,
193193
skip_hidden: bool = False,
194194
) -> AsyncIterator[dict[str, Any]]:

src/crawlee/storages/_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async def get_data(
146146
desc: bool = False,
147147
fields: list[str] | None = None,
148148
omit: list[str] | None = None,
149-
unwind: str | None = None,
149+
unwind: list[str] | None = None,
150150
skip_empty: bool = False,
151151
skip_hidden: bool = False,
152152
flatten: list[str] | None = None,
@@ -197,7 +197,7 @@ async def iterate_items(
197197
desc: bool = False,
198198
fields: list[str] | None = None,
199199
omit: list[str] | None = None,
200-
unwind: str | None = None,
200+
unwind: list[str] | None = None,
201201
skip_empty: bool = False,
202202
skip_hidden: bool = False,
203203
) -> AsyncIterator[dict[str, Any]]:
@@ -245,7 +245,7 @@ async def list_items(
245245
desc: bool = False,
246246
fields: list[str] | None = None,
247247
omit: list[str] | None = None,
248-
unwind: str | None = None,
248+
unwind: list[str] | None = None,
249249
skip_empty: bool = False,
250250
skip_hidden: bool = False,
251251
) -> list[dict[str, Any]]:

0 commit comments

Comments
 (0)