Skip to content

Commit 77c4bba

Browse files
committed
Add method to extract timestamp from Hugging Face file info
1 parent f37b087 commit 77c4bba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/galaxy/files/sources/huggingface.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ def _to_filesystem_path(self, path: str) -> str:
101101
# Remove leading slash for HF compatibility
102102
return path.lstrip("/")
103103

104+
def _extract_timestamp(self, info: dict) -> Optional[str]:
105+
"""Extract timestamp from Hugging Face file info to use it in the RemoteFile entry."""
106+
last_commit: dict = info.get("last_commit", {})
107+
return last_commit.get("date")
108+
104109
def _list(
105110
self,
106111
context: FilesSourceRuntimeContext[HuggingFaceFileSourceConfiguration],

0 commit comments

Comments
 (0)