Skip to content

Commit

Permalink
Merge pull request #2901 from activeloopai/creds_to_dict
Browse files Browse the repository at this point in the history
[DEEP-208] provide creds dict with non empty strings
  • Loading branch information
activesoull authored Jul 12, 2024
2 parents 9b95cab + b1203d4 commit a945190
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions deeplake/enterprise/convert_to_libdeeplake.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,26 @@ def _get_indra_ds_from_gcp_provider(

api = import_indra_api()
creds = provider.get_creds()
anon = creds.get("anon", "")
expiration = creds.get("expiration", "")
access_token = creds.get("access_token", "")
json_credentials = creds.get("json_credentials", "")
endpoint_override = creds.get("endpoint_override", "")
scheme = creds.get("scheme", "")
retry_limit_seconds = creds.get("retry_limit_seconds", "")
creds_dict = {
k: v
for k, v in {
"anon": creds.get("anon", ""),
"expiration": creds.get("expiration", ""),
"access_token": creds.get("access_token", ""),
"json_credentials": creds.get("json_credentials", ""),
"endpoint_override": creds.get("endpoint_override", ""),
"scheme": creds.get("scheme", ""),
"retry_limit_seconds": creds.get("retry_limit_seconds", ""),
}.items()
if v != ""
}

storage = IndraProvider(
path,
read_only=provider.read_only,
token=token,
origin_path=provider.root,
anon=anon,
expiration=expiration,
access_token=access_token,
json_credentials=json_credentials,
endpoint_override=endpoint_override,
scheme=scheme,
retry_limit_seconds=retry_limit_seconds,
**creds_dict,
)
return _get_indra_ds_from_native_provider(storage)

Expand Down

0 comments on commit a945190

Please sign in to comment.