Skip to content

Commit 40ffd1e

Browse files
committed
Make duration_ms in log_operation required
1 parent e0a4ae9 commit 40ffd1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/humanloop/sync/metadata_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class OperationData(TypedDict):
1616
successful_files: List[str]
1717
failed_files: List[str]
1818
error: NotRequired[Optional[str]]
19-
duration_ms: NotRequired[Optional[float]]
19+
duration_ms: float
2020

2121
class Metadata(TypedDict):
2222
"""Type definition for the metadata structure."""
@@ -73,22 +73,22 @@ def log_operation(
7373
self,
7474
operation_type: str,
7575
path: str,
76+
duration_ms: float,
7677
environment: Optional[str] = None,
7778
successful_files: Optional[List[str]] = None,
7879
failed_files: Optional[List[str]] = None,
7980
error: Optional[str] = None,
80-
duration_ms: Optional[float] = None
8181
) -> None:
8282
"""Log a sync operation.
8383
8484
Args:
8585
operation_type: Type of operation (e.g., "pull", "push")
8686
path: The path that was synced
87+
duration_ms: Duration of the operation in milliseconds
8788
environment: Optional environment name
8889
successful_files: List of successfully processed files
8990
failed_files: List of files that failed to process
9091
error: Any error message if the operation failed
91-
duration_ms: Optional duration of the operation in milliseconds
9292
"""
9393
current_time = datetime.now().isoformat()
9494

0 commit comments

Comments
 (0)