Skip to content
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

update to use v1 client #1216

Merged

Conversation

dizcology
Copy link
Member

Update the tutorial to use v1 client. Sample tests passed.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 13, 2017
@@ -90,7 +87,7 @@ def index(path, index_file):
print('Failed to process {}'.format(file_path))

with io.open(index_file, 'w', encoding='utf-8') as f:
f.write(json.dumps(result))
f.write(unicode(json.dumps(result)))
Copy link
Contributor

Choose a reason for hiding this comment

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

unicode doesn't exist on python 3, what you really want here is:

json.dump(result, f)

Copy link
Member Author

Choose a reason for hiding this comment

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

python 2.7's json.dump seems to use f.write and json.dump(result, f) still returns the following error:

TypeError: write() argument 1 must be unicode, not str

@theacodes theacodes merged commit 6f0f4f9 into GoogleCloudPlatform:master Nov 14, 2017
hkdevandla pushed a commit to hkdevandla/python-language that referenced this pull request Sep 26, 2020
busunkim96 pushed a commit to googleapis/python-language that referenced this pull request Sep 29, 2020
m-strzelczyk pushed a commit that referenced this pull request Nov 18, 2022
* update to use v1 client

* set ensure_ascii=False
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants