diff --git a/opteryx/__version__.py b/opteryx/__version__.py index 1b9d55c4c..73fcc5cdb 100644 --- a/opteryx/__version__.py +++ b/opteryx/__version__.py @@ -28,7 +28,7 @@ class VersionStatus(Enum): _major = 0 _minor = 13 -_revision = 1 +_revision = 2 _status = VersionStatus.RELEASE __author__ = "@joocer" diff --git a/opteryx/connectors/gcp_cloudstorage_connector.py b/opteryx/connectors/gcp_cloudstorage_connector.py index a1571a471..ed8d843fe 100644 --- a/opteryx/connectors/gcp_cloudstorage_connector.py +++ b/opteryx/connectors/gcp_cloudstorage_connector.py @@ -16,8 +16,6 @@ from typing import List import pyarrow -import requests -from google.auth.transport.requests import Request from orso.schema import RelationSchema from orso.tools import single_item_cache from orso.types import OrsoTypes @@ -52,8 +50,8 @@ class GcpCloudStorageConnector(BaseConnector, Cacheable, Partitionable, Predicat def __init__(self, credentials=None, **kwargs): try: - from google.auth.credentials import AnonymousCredentials - from google.cloud import storage + import requests + from google.auth.transport.requests import Request except ImportError as err: raise MissingDependencyError(err.name) from err @@ -82,7 +80,10 @@ def __init__(self, credentials=None, **kwargs): self.session = requests.Session() def _get_storage_client(self): - from google.cloud import storage + try: + from google.cloud import storage + except ImportError as err: + raise MissingDependencyError(err.name) from err if os.environ.get("STORAGE_EMULATOR_HOST"): from google.auth.credentials import AnonymousCredentials @@ -99,6 +100,8 @@ def read_blob(self, *, blob_name, **kwargs): # Ensure the credentials are valid, refreshing them if necessary if not self.client_credentials.valid: + from google.auth.transport.requests import Request + request = Request() self.client_credentials.refresh(request) self.access_token = self.client_credentials.token @@ -126,6 +129,8 @@ def get_list_of_blob_names(self, *, prefix: str) -> List[str]: # Ensure the credentials are valid, refreshing them if necessary if not self.client_credentials.valid: + from google.auth.transport.requests import Request + request = Request() self.client_credentials.refresh(request) self.access_token = self.client_credentials.token diff --git a/requirements.txt b/requirements.txt index c381c6efd..9c4de8244 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,5 @@ numpy orjson orso>=0.0.120 pyarrow>=12.0.1 -requests typer