Skip to content

Commit 50dde42

Browse files
committed
address feedback
1 parent f8aba0c commit 50dde42

File tree

10 files changed

+25
-73
lines changed

10 files changed

+25
-73
lines changed

src/crawlee/_types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ def __call__(
434434
435435
Args:
436436
id: The ID of the `KeyValueStore` to get.
437-
name: The name of the `KeyValueStore` to get (global scope).
438-
alias: The alias of the `KeyValueStore` to get (run scope, unnamed).
437+
name: The name of the `KeyValueStore` to get (global scope, named storage).
438+
alias: The alias of the `KeyValueStore` to get (run scope, unnamed storage).
439439
"""
440440

441441

@@ -456,8 +456,8 @@ def __call__(
456456
457457
Args:
458458
id: The ID of the `KeyValueStore` to get.
459-
name: The name of the `KeyValueStore` to get (global scope).
460-
alias: The alias of the `KeyValueStore` to get (run scope, unnamed).
459+
name: The name of the `KeyValueStore` to get (global scope, named storage).
460+
alias: The alias of the `KeyValueStore` to get (run scope, unnamed storage).
461461
"""
462462

463463

@@ -482,8 +482,8 @@ def __call__(
482482
Args:
483483
data: The data to push to the `Dataset`.
484484
dataset_id: The ID of the `Dataset` to push the data to.
485-
dataset_name: The name of the `Dataset` to push the data to (global scope).
486-
dataset_alias: The alias of the `Dataset` to push the data to (run scope, unnamed).
485+
dataset_name: The name of the `Dataset` to push the data to (global scope, named storage).
486+
dataset_alias: The alias of the `Dataset` to push the data to (run scope, unnamed storage).
487487
**kwargs: Additional keyword arguments.
488488
"""
489489

src/crawlee/crawlers/_basic/_basic_crawler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ async def get_data(
784784
785785
Args:
786786
dataset_id: The ID of the `Dataset`.
787-
dataset_name: The name of the `Dataset` (global scope).
788-
dataset_alias: The alias of the `Dataset` (run scope, unnamed).
787+
dataset_name: The name of the `Dataset` (global scope, named storage).
788+
dataset_alias: The alias of the `Dataset` (run scope, unnamed storage).
789789
kwargs: Keyword arguments to be passed to the `Dataset.get_data()` method.
790790
791791
Returns:
@@ -809,9 +809,9 @@ async def export_data(
809809
810810
Args:
811811
path: The destination file path. Must end with '.json' or '.csv'.
812-
dataset_id: The ID of the Dataset to export from. If None, uses `name` parameter instead.
813-
dataset_name: The name of the Dataset to export from (global scope). If None, uses `id` parameter instead.
814-
dataset_alias: The alias of the Dataset to export from (run scope, unnamed).
812+
dataset_id: The ID of the Dataset to export from.
813+
dataset_name: The name of the Dataset to export from (global scope, named storage).
814+
dataset_alias: The alias of the Dataset to export from (run scope, unnamed storage).
815815
"""
816816
dataset = await self.get_dataset(id=dataset_id, name=dataset_name, alias=dataset_alias)
817817

@@ -841,8 +841,8 @@ async def _push_data(
841841
Args:
842842
data: The data to push to the `Dataset`.
843843
dataset_id: The ID of the `Dataset`.
844-
dataset_name: The name of the `Dataset` (global scope).
845-
dataset_alias: The alias of the `Dataset` (run scope, unnamed).
844+
dataset_name: The name of the `Dataset` (global scope, named storage).
845+
dataset_alias: The alias of the `Dataset` (run scope, unnamed storage).
846846
kwargs: Keyword arguments to be passed to the `Dataset.push_data()` method.
847847
"""
848848
dataset = await self.get_dataset(id=dataset_id, name=dataset_name, alias=dataset_alias)

src/crawlee/storage_clients/_file_system/_dataset_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ async def open(
102102
103103
Args:
104104
id: The ID of the dataset to open. If provided, searches for existing dataset by ID.
105-
name: The name of the dataset for named storages. Mutually exclusive with alias.
106-
alias: The alias of the dataset for unnamed storages. Mutually exclusive with name.
105+
name: The name of the dataset for named (global scope) storages.
106+
alias: The alias of the dataset for unnamed (run scope) storages.
107107
configuration: The configuration object containing storage directory settings.
108108
109109
Returns:

src/crawlee/storage_clients/_file_system/_key_value_store_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ async def open(
101101
102102
Args:
103103
id: The ID of the key-value store to open. If provided, searches for existing store by ID.
104-
name: The name of the key-value store for named storages. Mutually exclusive with alias.
105-
alias: The alias of the key-value store for unnamed storages. Mutually exclusive with name.
104+
name: The name of the key-value store for named (global scope) storages.
105+
alias: The alias of the key-value store for unnamed (run scope) storages.
106106
configuration: The configuration object containing storage directory settings.
107107
108108
Returns:

src/crawlee/storage_clients/_file_system/_request_queue_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ async def open(
153153
154154
Args:
155155
id: The ID of the request queue to open. If provided, searches for existing queue by ID.
156-
name: The name of the request queue for named storages. Mutually exclusive with alias.
157-
alias: The alias of the request queue for unnamed storages. Mutually exclusive with name.
156+
name: The name of the request queue for named (global scope) storages.
157+
alias: The alias of the request queue for unnamed (run scope) storages.
158158
configuration: The configuration object containing storage directory settings.
159159
160160
Returns:

src/crawlee/storage_clients/_memory/_dataset_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ async def open(
6363
6464
Args:
6565
id: The ID of the dataset. If not provided, a random ID will be generated.
66-
name: The name of the dataset for named storages. Mutually exclusive with alias.
67-
alias: The alias of the dataset for unnamed storages. Mutually exclusive with name.
66+
name: The name of the dataset for named (global scope) storages.
67+
alias: The alias of the dataset for unnamed (run scope) storages.
6868
6969
Returns:
7070
An instance for the opened or created storage client.

src/crawlee/storage_clients/_memory/_key_value_store_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ async def open(
6161
6262
Args:
6363
id: The ID of the key-value store. If not provided, a random ID will be generated.
64-
name: The name of the key-value store for named storages. Mutually exclusive with alias.
65-
alias: The alias of the key-value store for unnamed storages. Mutually exclusive with name.
64+
name: The name of the key-value store for named (global scope) storages.
65+
alias: The alias of the key-value store for unnamed (run scope) storages.
6666
6767
Returns:
6868
An instance for the opened or created storage client.

src/crawlee/storage_clients/_memory/_request_queue_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ async def open(
7373
7474
Args:
7575
id: The ID of the request queue. If not provided, a random ID will be generated.
76-
name: The name of the request queue for named storages. Mutually exclusive with alias.
77-
alias: The alias of the request queue for unnamed storages. Mutually exclusive with name.
76+
name: The name of the request queue for named (global scope) storages.
77+
alias: The alias of the request queue for unnamed (run scope) storages.
7878
7979
Returns:
8080
An instance for the opened or created storage client.

tests/unit/storages/test_key_value_store.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -909,30 +909,6 @@ async def test_default_vs_alias_default_equivalence(
909909
await default_kvs.drop()
910910

911911

912-
async def test_alias_parameter_validation(
913-
storage_client: StorageClient,
914-
configuration: Configuration,
915-
) -> None:
916-
"""Test alias parameter validation."""
917-
# Should not allow both name and alias
918-
with pytest.raises(ValueError, match=r'Only one of'):
919-
await KeyValueStore.open(
920-
name='test',
921-
alias='test',
922-
storage_client=storage_client,
923-
configuration=configuration,
924-
)
925-
926-
# Valid alias should work
927-
alias_kvs = await KeyValueStore.open(
928-
alias='valid_alias',
929-
storage_client=storage_client,
930-
configuration=configuration,
931-
)
932-
assert alias_kvs.name is None
933-
await alias_kvs.drop()
934-
935-
936912
async def test_multiple_alias_isolation(
937913
storage_client: StorageClient,
938914
configuration: Configuration,

tests/unit/storages/test_request_queue.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,30 +1018,6 @@ async def test_default_vs_alias_default_equivalence(
10181018
await default_rq.drop()
10191019

10201020

1021-
async def test_alias_parameter_validation(
1022-
storage_client: StorageClient,
1023-
configuration: Configuration,
1024-
) -> None:
1025-
"""Test alias parameter validation."""
1026-
# Should not allow both name and alias
1027-
with pytest.raises(ValueError, match=r'Only one of'):
1028-
await RequestQueue.open(
1029-
name='test',
1030-
alias='test',
1031-
storage_client=storage_client,
1032-
configuration=configuration,
1033-
)
1034-
1035-
# Valid alias should work
1036-
alias_rq = await RequestQueue.open(
1037-
alias='valid_alias',
1038-
storage_client=storage_client,
1039-
configuration=configuration,
1040-
)
1041-
assert alias_rq.name is None
1042-
await alias_rq.drop()
1043-
1044-
10451021
async def test_multiple_alias_isolation(
10461022
storage_client: StorageClient,
10471023
configuration: Configuration,

0 commit comments

Comments
 (0)