You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The method get_trips triggers an exception upon retrieving a trip that contains a connection that does not have the connection.duration attribute set.
Apparently, the VVS API does not set the duration property in case a connection takes less than a minute, i.e. the duration would be 0. This is at least what I assume to be reason for not adding the duration.
Expected behavior
The request should not fail. If no duration is given, it probably is 0 and thus does not need to be part of the final sum.
Proof of Concept
The following request is one that triggers the exception. One part of the trip contains a connection with only one stop, taking less than a minute.
Suggestion
It has to be checked whether the duration attribute exists. If it does not exist, (I assume that) it is equal to 0 and therefore can be left out.
Describe the bug
The method
get_trips
triggers an exception upon retrieving a trip that contains a connection that does not have theconnection.duration
attribute set.Apparently, the VVS API does not set the duration property in case a connection takes less than a minute, i.e. the duration would be 0. This is at least what I assume to be reason for not adding the duration.
Expected behavior
The request should not fail. If no duration is given, it probably is 0 and thus does not need to be part of the final sum.
Proof of Concept
The following request is one that triggers the exception. One part of the trip contains a connection with only one stop, taking less than a minute.
Code fragment
The problematic code can be found in https://github.com/zaanposni/vvspy/blob/master/vvspy/obj/trip.py#L33:
Suggestion
It has to be checked whether the duration attribute exists. If it does not exist, (I assume that) it is equal to 0 and therefore can be left out.
The text was updated successfully, but these errors were encountered: