-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug add_poi_infos in journeys #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @SemiCroustii
Thank you for your contribution.
I am requesting changes as your proposal is not the way the typing is used in the project. Indeed the value can be "none" but the type is Sequence[str], so it should be at least ["none"]. In addition, this value is optional in the call (which is indeed not described in https://doc.navitia.io/#journeys), can you use the Optional type to reflect this ?
Also, please add a test using the payload which you would have received as a response to your API call. You can use the RawClient if necessary, and clean the payload from useless data.
@@ -42,7 +42,7 @@ class JourneyApiClient(ApiBaseClient): | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -79,7 +79,7 @@ class JourneyApiClient(ApiBaseClient): | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -116,7 +116,7 @@ class JourneyApiClient(ApiBaseClient): | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -173,7 +173,7 @@ def list_journeys( | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -333,7 +333,7 @@ def list_journeys_with_region_id( | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -495,7 +495,7 @@ def list_journeys_with_resource_path( | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -37,7 +37,7 @@ Methods | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Optional if value is nullable (see https://docs.python.org/3/library/typing.html#typing.Optional).
Also well catched that "none" is a possibile value, as it is not listed in the api catalog. Could you set the value as ["none"] to match wit the Sequence typing ?
@@ -74,7 +74,7 @@ Methods | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
@@ -111,7 +111,7 @@ Methods | |||
wheelchair: bool = False, | |||
direct_path: str = "indifferent", | |||
direct_path_mode: Optional[Sequence[str]] = None, | |||
add_poi_infos: Sequence[str] = [], | |||
add_poi_infos: Sequence[str] = "none", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
Fix issue in PR #63 * Add arg as optionnal (see documentation) * Update docs * Add tests to check URL
Fix issue described in PR #63 * Add arg as optional (see documentation) * Update docs * Add tests to check URL
Fix issue described in PR #63 * Add arg as optional (see documentation) * Update docs * Add tests to check URL
Available in version 1.1.3 |
I add a bug when using
client.journeys.list_journeys(from_ = "stop_area:SNCF:REDACTED", to_ = "stop_area:SNCF:REDACTED"))
I changed add_poi_infos default value to "none"