Ray Types Not Exported

How severe does this issue affect your experience of using Ray?

  • Low: It annoys or frustrates me for a moment.

All ray methods get Pylance reportPrivateImportUsage errors that they aren’t exported from module “ray”. The code still works, but all the bright red error markers in VSCode are very distracting. Is there a correct way to import ray to get these errors to go away?

For example:

import ray
ray.get_actor(...)  # <--- "get_actor" is not exported from module "ray" Pylance(reportPrivateImportUsage)

Thank you!

I think exporting types is a good idea, thanks for highlighting this! I have never set up a Python module to export types, do you know how it’s done?

1 Like

I’m not sure – I’m really not a Python guru. I just looked at the 2.2 code and it seems that those names are in the root module init.py __all__ declaration, which I think should export them, but they are not being found. So either I’m doing something wrong or Ray is. It’s very weird that some names are exported and others aren’t though. Why should ray.get import fine, but ray.get_actor not?