Skip to content

chore: onboard google-maps-mapmanagement API#16856

Open
noahdietz wants to merge 2 commits intogoogleapis:mainfrom
noahdietz:chore-onboard-library-2026-04-28
Open

chore: onboard google-maps-mapmanagement API#16856
noahdietz wants to merge 2 commits intogoogleapis:mainfrom
noahdietz:chore-onboard-library-2026-04-28

Conversation

@noahdietz
Copy link
Copy Markdown
Contributor

Onboard google-maps-mapmanagement API with initial v2beta version.

Produced by running the following commands:

$ V=$(sed -n 's/^version: *//p' librarian.yaml)
$ go run github.com/googleapis/librarian/tool/cmd/builddockerimages@${V} --version ${V} --language python
$ go run github.com/googleapis/librarian/cmd/librarian@${V} add google/maps/mapmanagement/v2beta
$ docker run -u $(id -u):$(id -g) -v .:/repo -v ~/.cache:/.cache -w /repo docker.io/library/librarian-python:${V}  generate google-maps-mapmanagement

Towards b/503325033

@noahdietz noahdietz requested review from a team as code owners April 28, 2026 21:14
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Apr 28, 2026

Here is the summary of changes.

You are about to add 30 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

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Apr 28, 2026

The docs error is something that suggests we might need to change the templates:

sphinx.errors.SphinxWarning: /home/runner/work/google-cloud-python/google-cloud-python/packages/google-maps-mapmanagement/docs/index.rst:20:toctree contains reference to nonexisting document 'CHANGELOG'

The librarian.yaml change looks good to me though.

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 initial implementation of the google-maps-mapmanagement Python client library, providing support for the Map Management v2beta API. The review feedback identifies a potential AttributeError in the async client's logging logic when credentials are not provided, recommends removing redundant Python 3.7 compatibility code as the library requires version 3.9 or higher, and corrects a malformed warning string that lacks an f-string prefix for variable interpolation.

Comment on lines +308 to +314
self._client._transport._credentials, "universe_domain", ""
),
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
"credentialsInfo": getattr(
self.transport._credentials, "get_cred_info", lambda: None
)(),
}
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.

high

This logging block will raise an AttributeError if self._client._transport._credentials is None. This occurs when a custom channel is provided to the client constructor, as credentials are then ignored. A check for None should be added before accessing attributes of _credentials to avoid crashing the client initialization.

                    "universeDomain": getattr(
                        self._client._transport._credentials, "universe_domain", ""
                    ) if self._client._transport._credentials else "",
                    "credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}" if self._client._transport._credentials else None,
                    "credentialsInfo": getattr(
                        self.transport._credentials, "get_cred_info", lambda: None
                    )() if self._client._transport._credentials else None,

Comment on lines +24 to +29
if sys.version_info >= (3, 8): # pragma: NO COVER
from importlib import metadata
else: # pragma: NO COVER
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
# this code path once we drop support for Python 3.7
import importlib_metadata as metadata
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

Since this package requires Python 3.9 or higher (as specified in setup.py), the compatibility check for Python 3.7 and the conditional import of importlib_metadata are unnecessary. This code path is dead and can be simplified.

from importlib import metadata

"Could not determine the version of Python "
+ "currently being used. To continue receiving "
+ "updates for {_package_label}, ensure you are "
+ "using a supported version of Python; see "
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 is missing the f prefix, so {_package_label} will be rendered as a literal string instead of being interpolated. Additionally, _package_label might not be defined if an exception occurs early in the try block. It is safer to use the literal package name here.

Suggested change
+ "using a supported version of Python; see "
+ "updates for google.maps.mapmanagement_v2beta, ensure you are "

@noahdietz
Copy link
Copy Markdown
Contributor Author

The docs error is something that suggests we might need to change the templates:

sphinx.errors.SphinxWarning: /home/runner/work/google-cloud-python/google-cloud-python/packages/google-maps-mapmanagement/docs/index.rst:20:toctree contains reference to nonexisting document 'CHANGELOG'

@jskeet Yes, just started a thread about it. I'm guessing you are referring to a Python generator template change?

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Apr 28, 2026

Either that or synthtool (which would be annoying - I've been trying not to touch it). Python folks will have better answers than me though.

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.

2 participants