feat(google/cloud/productregistry/v1): add google-cloud-productregistry#17783
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds the new google-cloud-productregistry client library package, including its configuration, documentation, generated client code, samples, and tests. It also refactors the import profiler script in scripts/import_profiler/profiler.py to simplify output formatting and statistical calculations. A potential NameError was identified in the profiler script where baseline_p50 could remain undefined if baseline_times is empty.
| if baseline_times: | ||
| baseline_p50, _, _ = _calculate_percentiles(baseline_times) | ||
| baseline_p50 = statistics.median(baseline_times) |
There was a problem hiding this comment.
If baseline_times is empty (e.g., if the baseline CSV file exists but contains no data rows), baseline_p50 will remain undefined. This will cause a NameError when evaluated on line 250 (if baseline_p50 is not None:).
Using a conditional expression ensures baseline_p50 is always defined (defaulting to None if the list is empty).
baseline_p50 = statistics.median(baseline_times) if baseline_times else Nonee2e797f to
b17eacf
Compare
|
I put these pull requests as draft as you may want to setup OSS Exit Gates and PyPI registration before merging this. |
🤖 I have created a release *beep* *boop* --- ## 0.1.0 (2026-07-21) ### Features * **google/cloud/productregistry/v1:** add google-cloud-productregistry ([#17783](#17783)) ([b7fa7df](b7fa7df)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Introducing google-cloud-productregistry package.
b/530253265
PiperOrigin-RevId: 941236329