Skip to content

fix: add missing f-string prefixes so samples print actual values - #14988

Open
KSnocom wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
KSnocom:fix-missing-fstring-prefixes
Open

KSnocom wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
KSnocom:fix-missing-fstring-prefixes

Conversation

@KSnocom

@KSnocom KSnocom commented Nov 19, 2026

Copy link
Copy Markdown

Description

Eleven print calls across five samples are plain strings containing {...} placeholders but no f prefix, so they print the template text instead of the values:

Sample Before (actual output) After
talent/job_search_list_jobs.py (4 lines) Job name: {job.name} Job name: projects/.../jobs/123
talent/job_search_histogram_search.py (4 lines) Job title: {job.title} the real title
dialogflow-cx/detect_intent_with_sentiment_analysis.py Sentiment Score: {score} the real score
storage/samples/snippets/storage_set_temporary_hold.py Temporary hold was set for #{blob_name} ... set for my-blob
storage/samples/snippets/storage_release_temporary_hold.py Temporary hold was release for #{blob_name} ... released for my-blob

The storage samples used Ruby-style #{...} interpolation, which Python doesn't support. I also fixed "was release" to "was released" in the same line.

Only the print lines change. Function signatures, return values and region tags are untouched, and no existing test asserts on these strings.

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended. (Not run against live APIs. Verified with flake8 and by evaluating the old and new strings: the old ones print the literal placeholders.)

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@KSnocom
KSnocom requested review from a team as code owners November 19, 2026 10:20
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: jobs Issues related to the Cloud Talent Solution Job Search API. api: storage Issues related to the Cloud Storage API. labels Nov 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request fixes several bugs across multiple Python sample files where string interpolation was intended but the f-prefix was missing from the print statements, causing literal curly braces to be printed instead of the variable values. It also corrects a minor typo ('release' to 'released') in one of the storage snippets. There are no review comments to address, and the changes look correct and complete.

@angelcaamal angelcaamal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: jobs Issues related to the Cloud Talent Solution Job Search API. api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants