Skip to content

fix : typing.List error from predict function #41

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arazig
Copy link

@arazig arazig commented Apr 15, 2025

Traceback (most recent call last):
File "/opt/conda/lib/python3.12/site-packages/mlflow/pyfunc/utils/data_validation.py", line 165, in _get_func_info_if_type_hint_supported
_infer_schema_from_list_type_hint(type_hint)
File "/opt/conda/lib/python3.12/site-packages/mlflow/types/type_hints.py", line 395, in _infer_schema_from_list_type_hint
internal_type = _get_element_type_of_list_type_hint(type_hint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/mlflow/types/type_hints.py", line 358, in _get_element_type_of_list_type_hint
raise InvalidTypeHintException(
mlflow.types.type_hints.InvalidTypeHintException: Type hint typing.List doesn't contain a collection element type. Fix by adding an element type to the collection type definition, e.g. list[str] instead of list.

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 this pull request may close these issues.

1 participant