Skip to content

Expose modify_time on LPath - #606

Merged
maximsmol merged 1 commit into
mainfrom
bg-agent/lpath-modify-time
Jul 27, 2026
Merged

Expose modify_time on LPath#606
maximsmol merged 1 commit into
mainfrom
bg-agent/lpath-modify-time

Conversation

@open-inspect-latchbio

Copy link
Copy Markdown

Summary

Exposes the modify_time metadata field on LPath, following the same pattern as the existing version_id, content_type, and size getters.

Changes

  • Added modify_time: Optional[datetime] to the internal _Cache.
  • Fetched modifyTime from ldataObjectMeta in the fetch_metadata GraphQL query.
  • Parsed the ISO 8601 timestamp into a datetime (normalizing a possible Z suffix, since datetime.fromisoformat only supports it on Python 3.11+, while the SDK targets >=3.9).
  • Cleared modify_time in _clear_cache.
  • Added a modify_time(*, load_if_missing=True) -> Optional[datetime] getter mirroring version_id.
  • Bumped version to 2.76.9 and added a changelog entry.

Usage

from latch.ldata.path import LPath

lp = LPath("latch://.../file.txt")
print(lp.modify_time())  # datetime with tzinfo, or None

Notes

The backing column modify_time (timestamp with time zone) exists on app_public.ldata_object_meta in vacuole and is exposed by Postgraphile as modifyTime.

@maximsmol
maximsmol merged commit 0cb43f2 into main Jul 27, 2026
10 checks passed
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