Skip to content

Commit

Permalink
Merge pull request #1418 from mabel-dev/0.13.2
Browse files Browse the repository at this point in the history
0.13.2
  • Loading branch information
joocer authored Feb 3, 2024
2 parents 6eef15e + d45e668 commit fd9a39d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion opteryx/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VersionStatus(Enum):

_major = 0
_minor = 13
_revision = 1
_revision = 2
_status = VersionStatus.RELEASE

__author__ = "@joocer"
Expand Down
15 changes: 10 additions & 5 deletions opteryx/connectors/gcp_cloudstorage_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ numpy
orjson
orso>=0.0.120
pyarrow>=12.0.1
requests
typer

0 comments on commit fd9a39d

Please sign in to comment.