File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
google/cloud/aiplatform/utils Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -617,15 +617,17 @@ def _timestamped_copy_to_gcs(
617617
618618
619619def get_timestamp_proto (
620- time : Optional [datetime .datetime ] = datetime . datetime . now () ,
620+ time : Optional [datetime .datetime ] = None ,
621621) -> timestamp_pb2 .Timestamp :
622622 """Gets timestamp proto of a given time.
623623 Args:
624624 time (datetime.datetime):
625- Required . A user provided time. Default to datetime.datetime.now() if not given.
625+ Optional . A user provided time. Default to datetime.datetime.now() if not given.
626626 Returns:
627- timestamp_pb2.Timestamp - timestamp proto of the given time, not have higher than millisecond precision.
627+ timestamp_pb2.Timestamp: timestamp proto of the given time, not have higher than millisecond precision.
628628 """
629+ if not time :
630+ time = datetime .datetime .now ()
629631 t = time .timestamp ()
630632 seconds = int (t )
631633 # must not have higher than millisecond precision.
You can’t perform that action at this time.
0 commit comments