chore: address codeql (#8037)
chore: address codeql (#8037)

* address codeql

* fix test
GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples