feat(google/developers/knowledge/v1): add google-developers-knowledge#17366
feat(google/developers/knowledge/v1): add google-developers-knowledge#17366suztomo wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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 " |
There was a problem hiding this comment.
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.
| + "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) |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| request_payload = type(request).to_json(request) | |
| except Exception: |
References
- 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: |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| except: | |
| except Exception: |
References
- 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: |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| except: | |
| except Exception: |
References
- 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: |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| except: | |
| except Exception: |
References
- 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: |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| except: | |
| except Exception: |
References
- Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.
| response | ||
| ) | ||
| ) | ||
| except: |
There was a problem hiding this comment.
Avoid using bare except: blocks as they can intercept system-level signals like KeyboardInterrupt or SystemExit, making debugging difficult. Catch Exception instead.
| except: | |
| except Exception: |
References
- Avoid using bare 'except:' blocks in Python code; catch specific exceptions or 'Exception' to avoid intercepting system-level signals like KeyboardInterrupt.
b/503382870