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

chore(job): rename and delete tags at jobs/v3/api_client/location_search_sample.py #13005

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions jobs/v3/api_client/location_search_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START instantiate]
import os
import time

from googleapiclient.discovery import build

client_service = build("jobs", "v3")
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
# [END instantiate]


# [START basic_location_search]
# [START job_basic_location_search]

Choose a reason for hiding this comment

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

Correctly renamed the [START] tag for the basic_location_search function. Adding a concise in-line comment explaining the function's purpose and parameters would improve readability. For example:

# Performs a basic location search for jobs using the provided client service, company name, location, and distance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Renaming region tags need to have the new region tag included, then updating the docs, then removing the old tag.

Suggested change
# [START job_basic_location_search]
# [START basic_location_search]
# [START job_basic_location_search]

(Change this in all other places. This is an earlier PR from you, you may have already adapted to this pattern since)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks glasnt!

Please check b/347825791 for more details on this example basic_location_search.
Documentation has already been fixed by yoshifumi in July 2024. (CL referenced in the Bug)

Even in this case, should I add both region tags? job_basic_location_search and basic_location_search

def basic_location_search(client_service, company_name, location, distance):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -47,10 +45,10 @@ def basic_location_search(client_service, company_name, location, distance):
print(response)


# [END basic_location_search]
# [END job_basic_location_search]

Choose a reason for hiding this comment

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

The [END] tag for basic_location_search is correctly updated to match the new name. Ensure all region tags within the project are consistently updated.



# [START keyword_location_search]
# [START job_keyword_location_search]

Choose a reason for hiding this comment

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

The [START] tag for keyword_location_search is accurately renamed. A brief explanation of how this function incorporates keyword search would be helpful. For example:

# Performs a keyword-based location search, adding a keyword filter to the job query.

def keyword_location_search(client_service, company_name, location, distance, keyword):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -72,10 +70,10 @@ def keyword_location_search(client_service, company_name, location, distance, ke
print(response)


# [END keyword_location_search]
# [END job_keyword_location_search]

Choose a reason for hiding this comment

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

Correctly renamed the [END] tag for keyword_location_search. Maintaining consistent and accurate region tags is crucial for documentation.



# [START city_location_search]
# [START job_city_location_search]

Choose a reason for hiding this comment

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

The [START] tag for city_location_search is correctly updated. Adding a short comment about the city-specific search logic would enhance clarity. For example:

# Performs a location search limited to a specific city.

def city_location_search(client_service, company_name, location):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -97,10 +95,10 @@ def city_location_search(client_service, company_name, location):
print(response)


# [END city_location_search]
# [END job_city_location_search]

Choose a reason for hiding this comment

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

Accurately renamed the [END] tag for city_location_search. Well-defined region tags contribute to well-structured documentation.



# [START multi_locations_search]
# [START job_multi_locations_search]

Choose a reason for hiding this comment

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

Correctly renamed the [START] tag for multi_locations_search. Consider adding a comment explaining the handling of multiple locations. For example:

# Performs a job search using multiple location filters.

def multi_locations_search(
client_service, company_name, location1, distance1, location2
):
Expand All @@ -125,10 +123,10 @@ def multi_locations_search(
print(response)


# [END multi_locations_search]
# [END job_multi_locations_search]

Choose a reason for hiding this comment

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

The [END] tag for multi_locations_search is correctly updated. Consistent naming and placement of region tags improve code maintainability.



# [START broadening_location_search]
# [START job_broadening_location_search]

Choose a reason for hiding this comment

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

The [START] tag for broadening_location_search is accurately renamed. A comment clarifying the broadening search behavior would be valuable. For example:

# Performs a location search with broadening enabled, expanding the search radius if initial results are limited.

def broadening_location_search(client_service, company_name, location):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -151,7 +149,7 @@ def broadening_location_search(client_service, company_name, location):
print(response)


# [END broadening_location_search]
# [END job_broadening_location_search]

Choose a reason for hiding this comment

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

The [END] tag for broadening_location_search correctly reflects the function name. Consistent use of region tags aids in clear documentation generation.



location = "Mountain View, CA"
Expand Down