Skip to content

Commit

Permalink
Merge pull request #2528 from activeloopai/init_used_creds
Browse files Browse the repository at this point in the history
[AL-2373] Init used creds
  • Loading branch information
levongh authored Aug 9, 2023
2 parents 891b7dc + 8749a4d commit 6c7c47b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion deeplake/util/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ def storage_provider_from_path(
path, read_only, db_engine=db_engine, token=token, creds=creds
)
else:
if isinstance(creds, str):
if isinstance(creds, str) and not path.startswith("s3://"):
creds = {}
if path.startswith("s3://"):
creds_used = "PLATFORM"
if creds == "ENV":
creds_used = "ENV"
elif isinstance(creds, dict) and set(creds.keys()) == {"profile_name"}:
creds_used = "ENV"
elif isinstance(creds, dict) and bool(creds):
creds_used = "DICT"
if isinstance(creds, str):
creds = {}
key = creds.get("aws_access_key_id")
secret = creds.get("aws_secret_access_key")
session_token = creds.get("aws_session_token")
Expand All @@ -76,6 +85,7 @@ def storage_provider_from_path(
profile_name=profile,
token=token,
)
storage.creds_used = creds_used
elif (
path.startswith("gcp://")
or path.startswith("gcs://")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def libdeeplake_availabe():
extras_require["all"] = [req_map[r] for r in all_extras]

if libdeeplake_availabe():
libdeeplake = "libdeeplake==0.0.65"
libdeeplake = "libdeeplake==0.0.66"
extras_require["enterprise"] = [libdeeplake, "pyjwt"]
extras_require["all"].append(libdeeplake)

Expand Down

0 comments on commit 6c7c47b

Please sign in to comment.