You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by cc...@apache.org on 2019/02/04 21:49:38 UTC
[beam] branch master updated: Python 3 fixes for GCP auth and Avro
IO
This is an automated email from the ASF dual-hosted git repository.
ccy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new dafe657 Python 3 fixes for GCP auth and Avro IO
new 29836b3 Merge pull request #7708 from charlesccychen/py3-fix
dafe657 is described below
commit dafe6576a130dcf915e2fd9d3c82b74c3a195618
Author: Charles Chen <cc...@google.com>
AuthorDate: Fri Feb 1 18:24:50 2019 -0800
Python 3 fixes for GCP auth and Avro IO
---
sdks/python/apache_beam/internal/gcp/auth.py | 2 +-
sdks/python/apache_beam/io/avroio.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sdks/python/apache_beam/internal/gcp/auth.py b/sdks/python/apache_beam/internal/gcp/auth.py
index cff8887..1c6d8e2 100644
--- a/sdks/python/apache_beam/internal/gcp/auth.py
+++ b/sdks/python/apache_beam/internal/gcp/auth.py
@@ -93,7 +93,7 @@ class _GCEMetadataCredentials(OAuth2Credentials):
token_url = ('http://{}/computeMetadata/v1/instance/service-accounts/'
'default/token').format(metadata_root)
req = Request(token_url, headers={'Metadata-Flavor': 'Google'})
- token_data = json.loads(urlopen(req).read())
+ token_data = json.loads(urlopen(req).read().decode('utf-8'))
self.access_token = token_data['access_token']
self.token_expiry = (refresh_time +
datetime.timedelta(seconds=token_data['expires_in']))
diff --git a/sdks/python/apache_beam/io/avroio.py b/sdks/python/apache_beam/io/avroio.py
index b648ad2..c56db6d 100644
--- a/sdks/python/apache_beam/io/avroio.py
+++ b/sdks/python/apache_beam/io/avroio.py
@@ -230,7 +230,7 @@ class _AvroUtils(object):
else:
codec = 'null'
- schema_string = meta[datafile.SCHEMA_KEY]
+ schema_string = meta[datafile.SCHEMA_KEY].decode('utf-8')
sync_marker = header['sync']
return codec, schema_string, sync_marker