Open
Description
Python 3.13 will be released in early October. We tested libraries against the final 3.13 release candidate in this PR: #37508
With running 3.13, azure-ai-ml raises an error due to how typing.Annotated is used in the utils.py file:
File "/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml/.tox/depends/lib/python3.13/site-packages/azure/ai/ml/_schema/pipeline/component_job.py", line 27, in <module>
from ...entities._inputs_outputs import Input
File "/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml/.tox/depends/lib/python3.13/site-packages/azure/ai/ml/entities/_inputs_outputs/__init__.py", line 57, in <module>
from .enum_input import EnumInput
File "/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml/.tox/depends/lib/python3.13/site-packages/azure/ai/ml/entities/_inputs_outputs/enum_input.py", line 10, in <module>
from .input import Input
File "/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml/.tox/depends/lib/python3.13/site-packages/azure/ai/ml/entities/_inputs_outputs/input.py", line 25, in <module>
from .utils import _get_param_with_standard_annotation, _remove_empty_values
File "/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml/.tox/depends/lib/python3.13/site-packages/azure/ai/ml/entities/_inputs_outputs/utils.py", line 28, in <module>
Annotation: TypeAlias = Union[str, Type, Annotated, None] # type: ignore
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/typing.py", line 432, in inner
return func(*args, **kwds)
File "/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/typing.py", line 576, in __getitem__
return self._getitem(self, parameters)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/typing.py", line 789, in Union
parameters = tuple(_type_check(p, msg) for p in parameters)
File "/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/typing.py", line 789, in <genexpr>
parameters = tuple(_type_check(p, msg) for p in parameters)
~~~~~~~~~~~^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/typing.py", line 200, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.Annotated is not valid as type argument
It would be good to fix this promptly in case there are other issues with 3.13.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment