[client] fix ClientRemoteMethod error message (#17726)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu 2021-08-11 00:43:17 -07:00 committed by GitHub
parent 9322f6aab5
commit abc593561c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,8 +259,9 @@ class ClientRemoteMethod(ClientStub):
self._method_name = method_name
def __call__(self, *args, **kwargs):
raise TypeError(f"Remote method cannot be called directly. "
f"Use {self._name}.remote() instead")
raise TypeError("Actor methods cannot be called directly. Instead "
f"of running 'object.{self._method_name}()', try "
f"'object.{self._method_name}.remote()'.")
def remote(self, *args, **kwargs):
return return_refs(ray.call_remote(self, *args, **kwargs))