From 2f37ef56234684019e01b466b73fc644e134e37b Mon Sep 17 00:00:00 2001 From: Harinayan <93434739+HariNayan@users.noreply.github.com> Date: Sat, 16 May 2026 11:56:18 +0530 Subject: [PATCH] docs: fix RouteMatrixElement duration return types Fixes #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. --- .../google/maps/routing_v2/types/routes_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-maps-routing/google/maps/routing_v2/types/routes_service.py b/packages/google-maps-routing/google/maps/routing_v2/types/routes_service.py index 9b62bcf9a0ae..48c5143c185c 100644 --- a/packages/google-maps-routing/google/maps/routing_v2/types/routes_service.py +++ b/packages/google-maps-routing/google/maps/routing_v2/types/routes_service.py @@ -630,7 +630,7 @@ class RouteMatrixElement(proto.Message): Independent of status. distance_meters (int): The travel distance of the route, in meters. - duration (google.protobuf.duration_pb2.Duration): + duration (datetime.timedelta): The length of time needed to navigate the route. If you set the [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference] @@ -639,7 +639,7 @@ class RouteMatrixElement(proto.Message): to either ``TRAFFIC_AWARE`` or ``TRAFFIC_AWARE_OPTIMAL``, then this value is calculated taking traffic conditions into account. - static_duration (google.protobuf.duration_pb2.Duration): + static_duration (datetime.timedelta): The duration of traveling through the route without taking traffic conditions into consideration.