Skip to content

Commit c83808a

Browse files
authored
Merge pull request #21072 from davelopez/25.1_fix_huggingface_timestamp
[25.1] Fix Huggingface timestamp parsing when `last_commit` is missing
2 parents ce14fe5 + 237c512 commit c83808a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/galaxy/files/sources/huggingface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _to_filesystem_path(self, path: str) -> str:
104104

105105
def _extract_timestamp(self, info: dict) -> Optional[str]:
106106
"""Extract timestamp from Hugging Face file info to use it in the RemoteFile entry."""
107-
last_commit: dict = info.get("last_commit", {})
107+
last_commit: dict = info.get("last_commit") or {}
108108
return last_commit.get("date")
109109

110110
def _get_file_hashes(self, info: dict) -> Optional[list[RemoteFileHash]]:

0 commit comments

Comments
 (0)