GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Fix timestamp proto util to default to timestamp at call time. (… · googleapis/python-aiplatform@d72a254

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform/utils
    • __init__.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/utils/__init__.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/utils/__init__.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,17 @@ def _timestamped_copy_to_gcs(
617617

618618

619619
def 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.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.