diff --git a/src/crawlee/_types.py b/src/crawlee/_types.py index 7f08a1ab29..42ac9412bd 100644 --- a/src/crawlee/_types.py +++ b/src/crawlee/_types.py @@ -612,7 +612,7 @@ class GetDataKwargs(TypedDict): omit: NotRequired[list[str]] """Fields to exclude from each item.""" - unwind: NotRequired[str] + unwind: NotRequired[list[str]] """Unwinds items by a specified array field, turning each element into a separate item.""" skip_empty: NotRequired[bool] diff --git a/src/crawlee/storage_clients/_base/_dataset_client.py b/src/crawlee/storage_clients/_base/_dataset_client.py index 0adc70b0a5..87573a3916 100644 --- a/src/crawlee/storage_clients/_base/_dataset_client.py +++ b/src/crawlee/storage_clients/_base/_dataset_client.py @@ -58,7 +58,7 @@ async def get_data( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, flatten: list[str] | None = None, @@ -79,7 +79,7 @@ async def iterate_items( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, ) -> AsyncIterator[dict[str, Any]]: diff --git a/src/crawlee/storage_clients/_file_system/_dataset_client.py b/src/crawlee/storage_clients/_file_system/_dataset_client.py index 54b0fe30ca..a3dae65a34 100644 --- a/src/crawlee/storage_clients/_file_system/_dataset_client.py +++ b/src/crawlee/storage_clients/_file_system/_dataset_client.py @@ -246,7 +246,7 @@ async def get_data( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, flatten: list[str] | None = None, @@ -345,7 +345,7 @@ async def iterate_items( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, ) -> AsyncIterator[dict[str, Any]]: diff --git a/src/crawlee/storage_clients/_memory/_dataset_client.py b/src/crawlee/storage_clients/_memory/_dataset_client.py index dd64a9d9ed..8426319acf 100644 --- a/src/crawlee/storage_clients/_memory/_dataset_client.py +++ b/src/crawlee/storage_clients/_memory/_dataset_client.py @@ -129,7 +129,7 @@ async def get_data( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, flatten: list[str] | None = None, @@ -188,7 +188,7 @@ async def iterate_items( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, ) -> AsyncIterator[dict[str, Any]]: diff --git a/src/crawlee/storages/_dataset.py b/src/crawlee/storages/_dataset.py index 680b45173b..36fbea8a7a 100644 --- a/src/crawlee/storages/_dataset.py +++ b/src/crawlee/storages/_dataset.py @@ -146,7 +146,7 @@ async def get_data( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, flatten: list[str] | None = None, @@ -197,7 +197,7 @@ async def iterate_items( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, ) -> AsyncIterator[dict[str, Any]]: @@ -245,7 +245,7 @@ async def list_items( desc: bool = False, fields: list[str] | None = None, omit: list[str] | None = None, - unwind: str | None = None, + unwind: list[str] | None = None, skip_empty: bool = False, skip_hidden: bool = False, ) -> list[dict[str, Any]]: