Skip to content

feat(google/developers/knowledge/v1): add google-developers-knowledge#17366

Open
suztomo wants to merge 1 commit into
googleapis:mainfrom
suztomo:onboard-new-library-2026-06-03-google/developers/knowledge/v1
Open

feat(google/developers/knowledge/v1): add google-developers-knowledge#17366
suztomo wants to merge 1 commit into
googleapis:mainfrom
suztomo:onboard-new-library-2026-06-03-google/developers/knowledge/v1

Conversation

@suztomo
Copy link
Copy Markdown
Member

@suztomo suztomo commented Jun 3, 2026

b/503382870

Copy link
Copy Markdown
Contributor

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

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 introduces the google-developers-knowledge package, a Python client library for the Google Developers Knowledge API (v1), along with its associated generated client code, documentation, tests, and samples. The review feedback highlights a missing f prefix on a warning string literal in google/developers/knowledge_v1/__init__.py that prevents variable interpolation, as well as multiple instances of bare except: blocks in transports/rest.py that should be updated to catch Exception instead to prevent intercepting system-level signals.

warnings.warn(
"Could not determine the version of Python "
+ "currently being used. To continue receiving "
+ "updates for {_package_label}, ensure you are "
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.

medium

The warning message contains a placeholder {_package_label} but the string literal is not prefixed with f, meaning it will be printed literally instead of being interpolated with the package label variable. Adding the f prefix to the string literal resolves this issue.

Suggested change
+ "updates for {_package_label}, ensure you are "
+ f"updates for {_package_label}, ensure you are "

)
method = transcoded_request["method"]
try:
request_payload = type(request).to_json(request)
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
request_payload = type(request).to_json(request)
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

response_payload = (
developerknowledge.BatchGetDocumentsResponse.to_json(response)
)
except:
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
except:
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

method = transcoded_request["method"]
try:
request_payload = type(request).to_json(request)
except:
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
except:
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

): # pragma: NO COVER
try:
response_payload = developerknowledge.Document.to_json(response)
except:
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
except:
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

method = transcoded_request["method"]
try:
request_payload = type(request).to_json(request)
except:
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
except:
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

response
)
)
except:
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.

medium

Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.

Suggested change
except:
except Exception:
References
  1. Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.

@suztomo suztomo marked this pull request as ready for review June 3, 2026 19:57
@suztomo suztomo requested review from a team as code owners June 3, 2026 19:57
@suztomo suztomo requested a review from daniel-sanche June 3, 2026 19:58
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Jun 3, 2026

Here is the summary of changes.

You are about to add 6 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

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.

1 participant