Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Star imports from mlserver.codecs not working #1153

Closed
jklaise opened this issue May 19, 2023 · 0 comments · Fixed by #1172
Closed

Star imports from mlserver.codecs not working #1153

jklaise opened this issue May 19, 2023 · 0 comments · Fixed by #1172

Comments

@jklaise
Copy link

jklaise commented May 19, 2023

For example:

from mlserver.codecs import *

Throws an error:

Traceback (most recent call last):
  File "/home/janis/.conda/envs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3460, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-b8cc62508f29>", line 1, in <module>
    from mlserver.codecs import *
AttributeError: module 'mlserver.codecs' has no attribute 'StringRequestCodec'

This is likely because __all__ is out-of-date with the actual imports. I haven't tested other sub-packages, but it might be worth looking at these.

P.S. I'm not a big fan of __all__ and star imports in particular, the main issue is that the existence of __all__ gives rise to two public APIs which may diverge (as it has in this case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant