From d03bb6a1b575cb5470157f971868e7b3c03ec2f2 Mon Sep 17 00:00:00 2001 From: Vaibhav Gupta Date: Wed, 12 Feb 2025 18:37:54 -0800 Subject: [PATCH] import typealias correctly for python 3.8+ from typing_extensions Fixes #1448 --- .../language_client_codegen/src/python/templates/types.py.j2 | 3 ++- integ-tests/python/baml_client/types.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/language_client_codegen/src/python/templates/types.py.j2 b/engine/language_client_codegen/src/python/templates/types.py.j2 index bbc7a7e9a..8c837846d 100644 --- a/engine/language_client_codegen/src/python/templates/types.py.j2 +++ b/engine/language_client_codegen/src/python/templates/types.py.j2 @@ -2,7 +2,8 @@ import baml_py from enum import Enum from pydantic import BaseModel, ConfigDict -from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union, TypeAlias +from typing_extensions import TypeAlias +from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union T = TypeVar('T') diff --git a/integ-tests/python/baml_client/types.py b/integ-tests/python/baml_client/types.py index 9d5644d6a..1e4f29f80 100644 --- a/integ-tests/python/baml_client/types.py +++ b/integ-tests/python/baml_client/types.py @@ -16,7 +16,8 @@ import baml_py from enum import Enum from pydantic import BaseModel, ConfigDict -from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union, TypeAlias +from typing_extensions import TypeAlias +from typing import Dict, Generic, List, Literal, Optional, TypeVar, Union T = TypeVar('T')