Commit 959891b7 authored by Yannick's avatar Yannick
Browse files

Merge branch 'dask_parameters' into 'master'

add dask parameters for gcp storage

See merge request !11
parents 26e03bd4 2bd9d7c3
Pipeline #61603 passed with stage
in 1 minute and 33 seconds
__version__ = '1.0.1'
__version__ = '1.1.0'
from typing import Optional
from osdu.core.api.storage.dask_storage_parameters import DaskStorageParameters
from osdu.core.api.storage.tenant import Tenant
from .blob_storage_gcp import GCloudAioStorage
async def get_dask_storage_parameters(tenant: Tenant, directory: Optional[str] = None) -> DaskStorageParameters:
gcp_store = GCloudAioStorage(service_account_file=tenant.credentials)
token = await gcp_store._get_access_token(tenant.project_id, tenant.bucket_name)
storage_options = {'token': token}
base_directory = f'{tenant.bucket_name}/{directory}' if directory else tenant.bucket_name
return DaskStorageParameters(protocol='gs',
base_directory=base_directory,
storage_options=storage_options)
# osdu core lib main python
--extra-index-url \
https://community.opengroup.org/api/v4/projects/465/packages/pypi/simple/
osdu-core-lib-python~=1.0.0
osdu-core-lib-python~=1.1.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment