@@ -478,56 +478,68 @@ def _get_storage_client(self, force_cloud: bool) -> Optional[ApifyClientAsync]:
478478 return self ._apify_client if force_cloud else None
479479
480480 @classmethod
481- async def open_dataset (cls , dataset_id_or_name : Optional [str ] = None , * , force_cloud : bool = False ) -> Dataset :
481+ async def open_dataset (cls , * , id : Optional [str ] = None , name : Optional [ str ] = None , force_cloud : bool = False ) -> Dataset :
482482 """Open a dataset.
483483
484484 Datasets are used to store structured data where each object stored has the same attributes,
485485 such as online store products or real estate offers.
486486 The actual data is stored either on the local filesystem or in the Apify cloud.
487487
488488 Args:
489- dataset_id_or_name (str, optional): ID or name of the dataset to be opened.
490- If not provided, the method returns the default dataset associated with the actor run.
489+ id (str, optional): ID of the dataset to be opened.
490+ If neither `id` nor `name` are provided, the method returns the default dataset associated with the actor run.
491+ name (str, optional): Name of the dataset to be opened.
492+ If neither `id` nor `name` are provided, the method returns the default dataset associated with the actor run.
491493 force_cloud (bool, optional): If set to `True` then the Apify cloud storage is always used.
492494 This way it is possible to combine local and cloud storage.
493495
494496 Returns:
495497 Dataset: An instance of the `Dataset` class for the given ID or name.
496498
497499 """
498- return await cls ._get_default_instance ().open_dataset (dataset_id_or_name = dataset_id_or_name , force_cloud = force_cloud )
500+ return await cls ._get_default_instance ().open_dataset (id = id , name = name , force_cloud = force_cloud )
499501
500- async def _open_dataset_internal (self , dataset_id_or_name : Optional [str ] = None , * , force_cloud : bool = False ) -> Dataset :
502+ async def _open_dataset_internal (self , * , id : Optional [str ] = None , name : Optional [ str ] = None , force_cloud : bool = False ) -> Dataset :
501503 self ._raise_if_not_initialized ()
502504
505+ dataset_id_or_name = id or name
503506 return await StorageManager .open_storage (Dataset , dataset_id_or_name , self ._get_storage_client (force_cloud ), self ._config )
504507
505508 @classmethod
506- async def open_key_value_store (cls , key_value_store_id_or_name : Optional [str ] = None , * , force_cloud : bool = False ) -> KeyValueStore :
509+ async def open_key_value_store (cls , * , id : Optional [str ] = None , name : Optional [ str ] = None , force_cloud : bool = False ) -> KeyValueStore :
507510 """Open a key-value store.
508511
509512 Key-value stores are used to store records or files, along with their MIME content type.
510513 The records are stored and retrieved using a unique key.
511514 The actual data is stored either on a local filesystem or in the Apify cloud.
512515
513516 Args:
514- key_value_store_id_or_name (str, optional): ID or name of the key-value store to be opened.
515- If not provided, the method returns the default key-value store associated with the actor run.
517+ id (str, optional): ID of the key-value store to be opened.
518+ If neither `id` nor `name` are provided, the method returns the default key-value store associated with the actor run.
519+ name (str, optional): Name of the key-value store to be opened.
520+ If neither `id` nor `name` are provided, the method returns the default key-value store associated with the actor run.
516521 force_cloud (bool, optional): If set to `True` then the Apify cloud storage is always used.
517522 This way it is possible to combine local and cloud storage.
518523
519524 Returns:
520525 KeyValueStore: An instance of the `KeyValueStore` class for the given ID or name.
521526 """
522- return await cls ._get_default_instance ().open_key_value_store (key_value_store_id_or_name = key_value_store_id_or_name , force_cloud = force_cloud )
527+ return await cls ._get_default_instance ().open_key_value_store (id = id , name = name , force_cloud = force_cloud )
523528
524- async def _open_key_value_store_internal (self , key_value_store_id_or_name : Optional [str ] = None , * , force_cloud : bool = False ) -> KeyValueStore :
529+ async def _open_key_value_store_internal (
530+ self ,
531+ * ,
532+ id : Optional [str ] = None ,
533+ name : Optional [str ] = None ,
534+ force_cloud : bool = False ,
535+ ) -> KeyValueStore :
525536 self ._raise_if_not_initialized ()
526537
538+ key_value_store_id_or_name = id or name
527539 return await StorageManager .open_storage (KeyValueStore , key_value_store_id_or_name , self ._get_storage_client (force_cloud ), self ._config )
528540
529541 @classmethod
530- async def open_request_queue (cls , request_queue_id_or_name : Optional [str ] = None , * , force_cloud : bool = False ) -> RequestQueue :
542+ async def open_request_queue (cls , * , id : Optional [str ] = None , name : Optional [ str ] = None , force_cloud : bool = False ) -> RequestQueue :
531543 """Open a request queue.
532544
533545 Request queue represents a queue of URLs to crawl, which is stored either on local filesystem or in the Apify cloud.
@@ -536,24 +548,28 @@ async def open_request_queue(cls, request_queue_id_or_name: Optional[str] = None
536548 and depth-first crawling orders.
537549
538550 Args:
539- request_queue_id_or_name (str, optional): ID or name of the request queue to be opened.
540- If not provided, the method returns the default request queue associated with the actor run.
551+ id (str, optional): ID of the request queue to be opened.
552+ If neither `id` nor `name` are provided, the method returns the default request queue associated with the actor run.
553+ name (str, optional): Name of the request queue to be opened.
554+ If neither `id` nor `name` are provided, the method returns the default request queue associated with the actor run.
541555 force_cloud (bool, optional): If set to `True` then the Apify cloud storage is always used.
542556 This way it is possible to combine local and cloud storage.
543557
544558 Returns:
545559 RequestQueue: An instance of the `RequestQueue` class for the given ID or name.
546560 """
547- return await cls ._get_default_instance ().open_request_queue (request_queue_id_or_name = request_queue_id_or_name , force_cloud = force_cloud )
561+ return await cls ._get_default_instance ().open_request_queue (id = id , name = name , force_cloud = force_cloud )
548562
549563 async def _open_request_queue_internal (
550564 self ,
551- request_queue_id_or_name : Optional [str ] = None ,
552565 * ,
566+ id : Optional [str ] = None ,
567+ name : Optional [str ] = None ,
553568 force_cloud : bool = False ,
554569 ) -> RequestQueue :
555570 self ._raise_if_not_initialized ()
556571
572+ request_queue_id_or_name = id or name
557573 return await StorageManager .open_storage (RequestQueue , request_queue_id_or_name , self ._get_storage_client (force_cloud ), self ._config )
558574
559575 @classmethod
0 commit comments