Skip to content

Commit aad233f

Browse files
authored
docs: Update docs about alias storages to match the implementation (#1751)
### Description - Current implementation does not give `alias='default'` any special meaning. - Unnamed default storage should be accessed without mentioning the alias.
1 parent 0080a42 commit aad233f

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

docs/guides/code_examples/storages/opening.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ async def main() -> None:
1010
# Unnamed storage with alias (purged on start)
1111
dataset_unnamed = await Dataset.open(alias='temporary-results')
1212

13-
# Default unnamed storage (both are equivalent and purged on start)
13+
# Default unnamed storage (purged on start)
1414
dataset_default = await Dataset.open()
15-
dataset_default = await Dataset.open(alias='default')
1615

1716

1817
if __name__ == '__main__':

docs/guides/storages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Crawlee supports two types of storages:
8383

8484
### Default storage
8585

86-
Each storage type (<ApiLink to="class/Dataset">`Dataset`</ApiLink>, <ApiLink to="class/KeyValueStore">`KeyValueStore`</ApiLink>, <ApiLink to="class/RequestQueue">`RequestQueue`</ApiLink>) has a default instance that can be accessed without specifying `id`, `name` or `alias`. Default unnamed storage is accessed by calling storage's `open` method without parameters. This is the most common way to use storages in simple crawlers. The special alias `"default"` is equivalent to calling `open` without parameters
86+
Each storage type (<ApiLink to="class/Dataset">`Dataset`</ApiLink>, <ApiLink to="class/KeyValueStore">`KeyValueStore`</ApiLink>, <ApiLink to="class/RequestQueue">`RequestQueue`</ApiLink>) has a default instance that can be accessed without specifying `id`, `name` or `alias`. Default unnamed storage is accessed by calling storage's `open` method without parameters. This is the most common way to use storages in simple crawlers.
8787

8888
<RunnableCodeBlock className="language-python" language="python">
8989
{OpeningExample}

src/crawlee/storages/_storage_instance_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ async def open_storage_instance(
117117
# Validate input parameters.
118118
raise_if_too_many_kwargs(id=id, name=name, alias=alias)
119119

120-
# Auto-set alias='default' when no parameters are specified.
121-
# Default unnamed storage is equal to alias=default unnamed storage.
120+
# Auto-set alias='__default__' when no parameters are specified.
122121
if not any([name, alias, id]):
123122
alias = self._DEFAULT_STORAGE_ALIAS
124123

0 commit comments

Comments
 (0)