这是indexloc提供的服务,不要输入任何密码
Skip to content

fix addressvalidation.py #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Python
uses: "actions/setup-python@v1"
uses: "actions/setup-python@v3"
with:
python-version: "${{ matrix.python-version }}"

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ googlemaps.egg-info
.vscode/
.idea/
index.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be added to gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need this for local development.

Note: I will submit a new pull request as single commit for all changes to this review round

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine if you need it for local development, but does it have to be added to the .gitignore file that everyone pulls down with the repo?

test.py
5 changes: 3 additions & 2 deletions googlemaps/addressvalidation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2022 Google Inc. All rights reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
Expand Down Expand Up @@ -77,4 +77,5 @@ def addressvalidation(client, addressLines, regionCode=None , locality=None, ena
return client._request("/v1:validateAddress", {}, # No GET params
base_url=_ADDRESSVALIDATION_BASE_URL,
extract_body=_addressvalidation_extract,
post_json=params)
post_json=params)

1 change: 0 additions & 1 deletion googlemaps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def __init__(self, key=None, client_id=None, client_secret=None,
"verify": True, # NOTE(cbro): verify SSL certs.
})

self.queries_quota : int
self.queries_per_second = queries_per_second
self.queries_per_minute = queries_per_minute
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_addressvalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class AddressValidationTest(TestCase):
def setUp(self):
self.key = "AIzaasdf"
self.key = "AIzaSyD_sJl0qMA65CYHMBokVfMNA7AKyt5ERYs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leaking an API key?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anglarett PTAL

self.client = googlemaps.Client(self.key)

@responses.activate
Expand Down