From d7c693a71445fde6eb561a2f97cb42cf6f3df18b Mon Sep 17 00:00:00 2001 From: Bjorn Pedersen Date: Thu, 23 Mar 2023 15:39:55 -0400 Subject: [PATCH] updated interactive/utils.py --- .../apache_beam/runners/interactive/utils.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sdks/python/apache_beam/runners/interactive/utils.py b/sdks/python/apache_beam/runners/interactive/utils.py index bdd9ab4d1a89..8c854d06e679 100644 --- a/sdks/python/apache_beam/runners/interactive/utils.py +++ b/sdks/python/apache_beam/runners/interactive/utils.py @@ -27,14 +27,14 @@ from typing import Dict from typing import Tuple +from google.cloud import storage + import pandas as pd import apache_beam as beam from apache_beam.dataframe.convert import to_pcollection from apache_beam.dataframe.frame_base import DeferredBase from apache_beam.internal.gcp import auth -from apache_beam.internal.http_client import get_new_http -from apache_beam.io.gcp.internal.clients import storage from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.pipeline import Pipeline from apache_beam.portability.api import beam_runner_api_pb2 @@ -452,13 +452,9 @@ def assert_bucket_exists(bucket_name): """ try: from apitools.base.py.exceptions import HttpError - storage_client = storage.StorageV1( - credentials=auth.get_service_credentials(PipelineOptions()), - get_credentials=False, - http=get_new_http(), - response_encoding='utf8') - request = storage.StorageBucketsGetRequest(bucket=bucket_name) - storage_client.buckets.Get(request) + storage_client = storage.Client( + credentials=auth.get_service_credentials(PipelineOptions())) + storage_client.get_bucket(bucket_name) except HttpError as e: if e.status_code == 404: _LOGGER.error('%s bucket does not exist!', bucket_name)