feat: Create sample for routeoptimization#12118
Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
|
Tests blocked by API enablement (or enablement propagation) |
|
Enabled the api in the testing project, re-running tests. |
Looks like that field doesn't exist? |
ghost
left a comment
There was a problem hiding this comment.
Hi team,
I'm currently reviewing this pull request and will provide feedback shortly. In the meantime, here's a summary for you and other reviewers to quickly get up to speed:
This pull request, authored by bshi, aims to add a new sample for the Route Optimization API. The changes include:
- Added a new sample directory:
routeoptimization/snippets/containing code for optimizing tours using the Route Optimization API. - Updated
CODEOWNERS: Line 120 was added to assign ownership of the new sample directory to@GoogleCloudPlatform/geo-routeoptimization,@GoogleCloudPlatform/python-samples-reviewers, and@GoogleCloudPlatform/cloud-samples-reviewers. - Updated
blunderbuss.yml: Lines 330-332 were added to automatically assign reviewers for pull requests related to the Route Optimization API to@GoogleCloudPlatform/geo-routeoptimization. - Added a
README.rstfile: This file provides instructions on setting up the environment and running the sample code (lines 1-20). - Added
noxfile_config.py: This file configures the testing environment (lines 1-42). - Added
optimize_tours.py: This file contains the core logic for optimizing tours (lines 1-59). - Added
optimize_tours_test.py: This file contains unit tests for the sample code (lines 1-28). - Added
requirements-test.txt: Specifies testing dependencies (lines 1-2). - Added
requirements.txt: Specifies runtime dependencies (line 1).
The author has indicated that the Route Optimization API needs to be enabled in testing projects, and the pull request includes a checklist to ensure all necessary steps are completed before merging. I'll be checking the test results and code quality during my review.
Here's a little haiku to brighten your day:
Routes optimize now,
Code flows smoothly, clear and bright,
Happy testing all!
|
@davidcavazos I apologize for the delay. Addressed your comments. |
ghost
left a comment
There was a problem hiding this comment.
This pull request adds a sample for the Route Optimization API. The sample code looks good, and the tests seem well-structured. However, there are a few minor improvements and a couple of missing checks that need to be addressed before merging.
195c19e to
e3ada70
Compare
ghost
left a comment
There was a problem hiding this comment.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed:
This pull request, authored by bshi, aims to add a new sample for the Route Optimization API. The changes include:
- New sample directory: A new directory
routeoptimization/snippetshas been created to house the sample code. - Updated
CODEOWNERSfile (line 92): TheCODEOWNERSfile has been updated to assign ownership of the new sample directory to the@GoogleCloudPlatform/geo-routeoptimization,@GoogleCloudPlatform/python-samples-reviewers, and@GoogleCloudPlatform/cloud-samples-reviewersteams. - Updated
blunderbuss.ymlfile (lines 261-265): Theblunderbuss.ymlfile has been updated to correctly assign pull requests related to the Route Optimization API to the appropriate team. - New README.rst file (routeoptimization/snippets/README.rst): A new README file provides instructions for setting up and running the sample locally. (lines 1-20)
- New Python sample file (routeoptimization/snippets/optimize_tours.py): This file contains the core logic for using the Route Optimization API. (lines 1-59)
- New test file (routeoptimization/snippets/optimize_tours_test.py): This file includes tests to verify the functionality of the sample code. (lines 1-29)
- New requirements files:
requirements.txtandrequirements-test.txtspecify the necessary dependencies for the sample and its tests. (lines 1-2 and 1-1 respectively) - New noxfile_config.py: This file contains configuration for the nox testing framework. (lines 1-42)
The author has indicated that the Route Optimization API needs to be enabled in testing projects, and that tests pass using nox -s py-3.9 and nox -s lint.
I'll be checking the functionality and code quality shortly. Let me know if you have any questions in the meantime.
And now, a little haiku to brighten your day:
Routes optimize well,
Code flows smoothly, clear and bright,
Review's a swift breeze.
ghost
left a comment
There was a problem hiding this comment.
The sample code and tests look good. A few minor suggestions for improvement are included below.
| import optimize_tours | ||
|
|
||
|
|
||
| @Retry |
|
|
||
|
|
||
| @Retry | ||
| def test_call_sync_api() -> None: |
There was a problem hiding this comment.
It's a good practice to explicitly set the retry argument. Refer to this documentation for more details: https://googleapis.dev/python/google-api-core/latest/retry.html
| def test_call_sync_api() -> None: | |
| @Retry(deadline=600) | |
| def test_call_sync_api() -> None: |
|
Since this PR was created, we're introduced Python 3.13 testing. Please rebase this PR to ensure this check passes (if this API doesn't yet support Python 3.13, please update the noxfile to ignore this version) |
|
Hi! You haven't replied to this PR in 6 months; it looks like this change is no longer a priority for you. If this PR has been closed in error, please re-open and address previous review comments ✨ |
Description
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)