Skip to content
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

Refactoring PlaceUri in distributed #3970

Merged
merged 22 commits into from
Apr 14, 2023
Merged

Refactoring PlaceUri in distributed #3970

merged 22 commits into from
Apr 14, 2023

Conversation

azime
Copy link
Contributor

@azime azime commented Apr 6, 2023

No description provided.

@xlqian xlqian requested review from xlqian and pbench and removed request for xlqian April 6, 2023 19:16
@xlqian xlqian changed the title Refactoring Refactoring PlaceUri in distributed Apr 6, 2023
Comment on lines 158 to 163
if response and response.journeys and response.journeys[0].sections:
if pt_object_origin.embedded_type == type_pb2.POI:
response.journeys[0].sections[0].origin.CopyFrom(pt_object_origin)
if pt_object_destination.embedded_type == type_pb2.POI:
response.journeys[0].sections[-1].destination.CopyFrom(pt_object_destination)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that I understand this piece of code. The reason is: I don't understand why we do have a piece of code to fill up origin and destination that is specific to POI. Wouldn't we have something similar for addresses or stops too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to do it for other objects

Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a comment, something like this?

# In case of a POI, it might be an access point, but we want the parent POI to be shown on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍


pt_object_origin = None
pt_object_destination = None
if request.get('origin'):
Copy link
Contributor

Choose a reason for hiding this comment

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

request.get("origin") is called 4 times in the following lines. Maybe putting it in a variable would be interesting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Abderrahim AZIME added 2 commits April 12, 2023 09:38
@azime azime removed the run_artemis label Apr 12, 2023
Abderrahim AZIME added 2 commits April 13, 2023 12:29
Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

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

def get_detail_pt_object(self, instance, arg_pt_object, request_id):
if not arg_pt_object:
return None
detail = self.get_entrypoint_detail(arg_pt_object, instance, request_id="{}".format(request_id))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
detail = self.get_entrypoint_detail(arg_pt_object, instance, request_id="{}".format(request_id))
detail = self.get_entrypoint_detail(arg_pt_object, instance, request_id=request_id)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 158 to 163
if response and response.journeys and response.journeys[0].sections:
if pt_object_origin.embedded_type == type_pb2.POI:
response.journeys[0].sections[0].origin.CopyFrom(pt_object_origin)
if pt_object_destination.embedded_type == type_pb2.POI:
response.journeys[0].sections[-1].destination.CopyFrom(pt_object_destination)

Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a comment, something like this?

# In case of a POI, it might be an access point, but we want the parent POI to be shown on.

Abderrahim AZIME added 2 commits April 14, 2023 12:25
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

91.9% 91.9% Coverage
0.0% 0.0% Duplication

@azime azime merged commit fdb4f4d into dev Apr 14, 2023
@azime azime deleted the refactoring branch April 14, 2023 13:14
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.

3 participants