chore: complete migration of google-cloud-biglake-hive#16684
chore: complete migration of google-cloud-biglake-hive#16684jskeet wants to merge 1 commit intogoogleapis:mainfrom
Conversation
The code changes here are due to the package not having been regenerated with the latest version of legacylibrarian. Fixes googleapis/librarian#5336
There was a problem hiding this comment.
Code Review
This pull request updates the library to support Python 3.9+ and drops support for Python 3.7, 3.8, and Protobuf 3.x. Changes include updated metadata, documentation, and Nox configurations, as well as the addition of type hints and refined mTLS endpoint resolution. Tests were modernized using parenthesized context managers. Review feedback suggests adding a type hint to the api_endpoint parameter and using built-in collection types for type hinting as per PEP 585.
|
|
||
| @staticmethod | ||
| def _get_default_mtls_endpoint(api_endpoint): | ||
| def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]: |
There was a problem hiding this comment.
The parameter api_endpoint is missing a type hint. Since this PR adds a return type hint to this method, the parameter should also be hinted for consistency and better type checking. Based on the docstring, the type is Optional[str].
| def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]: | |
| def _get_default_mtls_endpoint(api_endpoint: Optional[str]) -> Optional[str]: |
References
- PEP 484 – Type Hints (link)
| host += ":443" | ||
| self._host = host | ||
|
|
||
| self._wrapped_methods: Dict[Callable, Callable] = {} |
There was a problem hiding this comment.
Since the package now requires Python 3.9+, you should use the built-in dict for type hinting instead of typing.Dict, as per PEP 585.
| self._wrapped_methods: Dict[Callable, Callable] = {} | |
| self._wrapped_methods: dict[Callable, Callable] = {} |
References
- PEP 585 – Type Hinting Generics In Standard Collections (link)
The code changes here are due to the package not having been regenerated with the latest version of legacylibrarian.
Fixes googleapis/librarian#5336