diff --git a/src/apify_client/_resource_clients/_resource_client.py b/src/apify_client/_resource_clients/_resource_client.py index f64843a8..f1821377 100644 --- a/src/apify_client/_resource_clients/_resource_client.py +++ b/src/apify_client/_resource_clients/_resource_client.py @@ -62,6 +62,8 @@ def __init__( """ if resource_path.endswith('/'): raise ValueError('resource_path must not end with "/"') + if resource_id is not None and resource_id == '': + raise ValueError('resource_id must not be an empty string') self._base_url = base_url self._api_base_url = api_base_url or base_url diff --git a/src/apify_client/_resource_clients/user.py b/src/apify_client/_resource_clients/user.py index 13ccd6f1..5ba948fa 100644 --- a/src/apify_client/_resource_clients/user.py +++ b/src/apify_client/_resource_clients/user.py @@ -50,7 +50,7 @@ def __init__( **kwargs: Any, ) -> None: super().__init__( - resource_id=resource_id or 'me', + resource_id='me' if resource_id is None else resource_id, resource_path=resource_path, **kwargs, ) @@ -170,7 +170,7 @@ def __init__( **kwargs: Any, ) -> None: super().__init__( - resource_id=resource_id or 'me', + resource_id='me' if resource_id is None else resource_id, resource_path=resource_path, **kwargs, )