diff --git a/CHANGELOG.md b/CHANGELOG.md index bdbe3927..70ac198b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ Types of changes # Latch SDK Changelog +## 2.76.5 - 2026-06-22 + +* Fix LatchFilePathTransformer for Annotated types ## 2.76.3 - 2026-06-19 diff --git a/pyproject.toml b/pyproject.toml index 52592617..2acc7ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ include = ["src/**/*.py", "src/**/*.graphql", "src/**/py.typed", "src/latch_cli/ [project] name = "latch" -version = "2.76.4" +version = "2.76.5" description = "The Latch SDK" authors = [{ name = "Kenny Workman", email = "kenny@latch.bio" }] maintainers = [{ name = "Kenny Workman", email = "kenny@latch.bio" }] diff --git a/src/latch/types/file.py b/src/latch/types/file.py index 25d2de6a..5b248993 100644 --- a/src/latch/types/file.py +++ b/src/latch/types/file.py @@ -1,7 +1,7 @@ import os from os import PathLike from pathlib import Path -from typing import Annotated, Optional, Union +from typing import Annotated, Optional, Union, get_args, get_origin from urllib.parse import urlparse import gql @@ -249,6 +249,9 @@ def to_python_value( "Casting from Pathlike to LatchFile is currently not supported." ) + while get_origin(expected_python_type) == Annotated: + expected_python_type = get_args(expected_python_type)[0] + if not issubclass(expected_python_type, LatchFile): raise TypeError( f"Neither os.PathLike nor LatchFile specified {expected_python_type}" diff --git a/uv.lock b/uv.lock index 0de0cb5d..186c9216 100644 --- a/uv.lock +++ b/uv.lock @@ -1255,7 +1255,7 @@ wheels = [ [[package]] name = "latch" -version = "2.76.3" +version = "2.76.5" source = { editable = "." } dependencies = [ { name = "apscheduler" },