Skip to content

docs: fix RouteMatrixElement duration return types#17161

Open
HariNayan wants to merge 1 commit into
googleapis:mainfrom
HariNayan:HariNayan-patch-1
Open

docs: fix RouteMatrixElement duration return types#17161
HariNayan wants to merge 1 commit into
googleapis:mainfrom
HariNayan:HariNayan-patch-1

Conversation

@HariNayan
Copy link
Copy Markdown

I have read the CONTRIBUTING.md file.
YES

What kind of change does this PR introduce?
docs update

What is the current behavior?
Closes #16522

The Prisma Quickstart Guide documents RouteMatrixElement.duration
and static_duration as google.protobuf.duration_pb2.Duration,
but at runtime both fields return datetime.timedelta objects.

This mismatch occurs because proto-plus automatically marshals
protobuf Duration types into Python's native datetime.timedelta.

What is the new behavior?
Updated type annotations in routes_service.py:

  • duration (google.protobuf.duration_pb2.Duration)duration (datetime.timedelta)
  • static_duration (google.protobuf.duration_pb2.Duration)static_duration (datetime.timedelta)

Additional context
This is consistent with how proto-plus handles Duration marshalling
across the googleapis Python client libraries. The fix ensures the
documentation matches the actual runtime behavior users observe.

Fixes googleapis#16522

Updated the RouteMatrixElement documentation to reflect that
duration and static_duration are returned as datetime.timedelta
objects at runtime rather than google.protobuf.duration_pb2.Duration.
@HariNayan HariNayan requested a review from a team as a code owner May 16, 2026 09:30
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 16, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the docstrings for the duration and static_duration fields in the RouteMatrixElement class to reflect the use of datetime.timedelta instead of google.protobuf.duration_pb2.Duration. I have no feedback to provide as there were no review comments.

@HariNayan
Copy link
Copy Markdown
Author

@googlebot check cla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs say RouteMatrixElement.duration is Duration, but runtime returns datetime.timedelta

1 participant