Update bugout token #175
21891 tests run, 11533 passed, 10352 skipped, 6 failed.
Annotations
Check failure on line 497 in deeplake/core/vectorstore/deep_memory/test_deepmemory.py
github-actions / JUnit Test Report
test_deepmemory.test_deepmemory_list_jobs
deeplake.util.exceptions.InvalidTokenException: Token is invalid. Make sure the full token string is included and try again.
Raw output
self = <deeplake.client.client.DeepLakeBackendClient object at 0x11fde4400>
org_id = 'testingacc2', ds_name = 'deepmemory_test_corpus_managed_2', mode = 'w'
db_engine = {'enabled': {'tensor_db': True}}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
> response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
deeplake/client/client.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deeplake/client/client.py:148: in request
check_response_status(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [403]>
def check_response_status(response: requests.Response):
"""Check response status and throw corresponding exception on failure."""
code = response.status_code
if code >= 200 and code < 300:
return
try:
message = response.json()["description"]
except Exception:
message = " "
if code == 400:
raise BadRequestException(message)
elif response.status_code == 401:
raise AuthenticationException
elif response.status_code == 403:
> raise AuthorizationException(message, response=response)
E deeplake.util.exceptions.AuthorizationException: You don't have permission to write to this dataset (testingacc2/deepmemory_test_corpus_managed_2). If you have read permissions try accessing it with read_only=True.
deeplake/client/utils.py:60: AuthorizationException
During handling of the above exception, another exception occurred:
self = <deeplake.client.client.DeepLakeBackendClient object at 0x11fde4400>
org_id = 'testingacc2', ds_name = 'deepmemory_test_corpus_managed_2', mode = 'w'
db_engine = {'enabled': {'tensor_db': True}}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
except Exception as e:
if isinstance(e, AuthorizationException):
response_data = e.response.json()
code = response_data.get("code")
if code == 1:
agreements = response_data["agreements"]
agreements = [agreement["text"] for agreement in agreements]
raise AgreementNotAcceptedError(agreements) from e
elif code == 2:
raise NotLoggedInAgreementError from e
else:
try:
> jwt.decode(self.token, options={"verify_signature": False})
E AttributeError: 'DeepLakeBackendClient' object has no attribute 'token'
deeplake/client/client.py:218: AttributeError
During handling of the above exception, another exception occurred:
jobs_list = 'ID STATUS RESULTS PROGRESS \n65198efcd28df3238c49a849 comple...) eta: 2.4 seconds\n recall@10: 50.00% (+25.00%)'
corpus_query_pair_path = ('hub://testingacc2/deepmemory_test_corpus_managed_2', 'hub://testingacc2/deepmemory_test_corpus_managed_2_eval_queries')
hub_cloud_dev_token = 'eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJpZCI6InRlc3RpbmdhY2MyIiwiYXBpX2tleSI6IjU4Y0tLb1p6UE1BbThPU2RpbTRiZ2tBekhWekt1VUE3MFJpNTNyZUpKRTJuaiJ9.'
@pytest.mark.skipif(sys.platform == "win32", reason="Does not run on Windows")
def test_deepmemory_list_jobs(jobs_list, corpus_query_pair_path, hub_cloud_dev_token):
corpus, _ = corpus_query_pair_path
db = VectorStore(
corpus,
runtime={"tensor_db": True},
token=hub_cloud_dev_token,
read_only=True,
)
> output_str = db.deep_memory.list_jobs(debug=True)
deeplake/core/vectorstore/deep_memory/test_deepmemory.py:497:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deeplake/core/vectorstore/deep_memory/deep_memory.py:46: in wrapper
return func(self, *args, **kwargs)
deeplake/core/vectorstore/deep_memory/deep_memory.py:329: in list_jobs
_, storage = get_storage_and_cache_chain(
deeplake/util/storage.py:244: in get_storage_and_cache_chain
storage = storage_provider_from_path(
deeplake/util/storage.py:66: in storage_provider_from_path
storage = storage_provider_from_hub_path(
deeplake/util/storage.py:164: in storage_provider_from_hub_path
url, final_creds, mode, expiration, repo = get_dataset_credentials(
deeplake/util/storage.py:141: in get_dataset_credentials
url, final_creds, mode, expiration, repo = client.get_dataset_credentials(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <deeplake.client.client.DeepLakeBackendClient object at 0x11fde4400>
org_id = 'testingacc2', ds_name = 'deepmemory_test_corpus_managed_2', mode = 'w'
db_engine = {'enabled': {'tensor_db': True}}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
except Exception as e:
if isinstance(e, AuthorizationException):
response_data = e.response.json()
code = response_data.get("code")
if code == 1:
agreements = response_data["agreements"]
agreements = [agreement["text"] for agreement in agreements]
raise AgreementNotAcceptedError(agreements) from e
elif code == 2:
raise NotLoggedInAgreementError from e
else:
try:
jwt.decode(self.token, options={"verify_signature": False})
except Exception:
> raise InvalidTokenException
E deeplake.util.exceptions.InvalidTokenException: Token is invalid. Make sure the full token string is included and try again.
deeplake/client/client.py:220: InvalidTokenException
Check failure on line 82 in deeplake/api/tests/test_api.py
github-actions / JUnit Test Report
test_api.test_persist[hub_cloud_ds_generator]
deeplake.util.exceptions.InvalidTokenException: Token is invalid. Make sure the full token string is included and try again.
Raw output
self = <deeplake.client.client.DeepLakeBackendClient object at 0x13e22ceb0>
org_id = 'testingacc2'
ds_name = 'tmp655b_test_api_test_persist-hub_cloud_ds_generator-', mode = None
db_engine = {'enabled': False}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
> response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
deeplake/client/client.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deeplake/client/client.py:148: in request
check_response_status(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [403]>
def check_response_status(response: requests.Response):
"""Check response status and throw corresponding exception on failure."""
code = response.status_code
if code >= 200 and code < 300:
return
try:
message = response.json()["description"]
except Exception:
message = " "
if code == 400:
raise BadRequestException(message)
elif response.status_code == 401:
raise AuthenticationException
elif response.status_code == 403:
> raise AuthorizationException(message, response=response)
E deeplake.util.exceptions.AuthorizationException: You don't have permission to write to this dataset (testingacc2/tmp655b_test_api_test_persist-hub_cloud_ds_generator-). If you have read permissions try accessing it with read_only=True.
deeplake/client/utils.py:60: AuthorizationException
During handling of the above exception, another exception occurred:
self = <deeplake.client.client.DeepLakeBackendClient object at 0x13e22ceb0>
org_id = 'testingacc2'
ds_name = 'tmp655b_test_api_test_persist-hub_cloud_ds_generator-', mode = None
db_engine = {'enabled': False}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
except Exception as e:
if isinstance(e, AuthorizationException):
response_data = e.response.json()
code = response_data.get("code")
if code == 1:
agreements = response_data["agreements"]
agreements = [agreement["text"] for agreement in agreements]
raise AgreementNotAcceptedError(agreements) from e
elif code == 2:
raise NotLoggedInAgreementError from e
else:
try:
> jwt.decode(self.token, options={"verify_signature": False})
E AttributeError: 'DeepLakeBackendClient' object has no attribute 'token'
deeplake/client/client.py:218: AttributeError
During handling of the above exception, another exception occurred:
ds_generator = <function hub_cloud_ds_generator.<locals>.generate_hub_cloud_ds at 0x13dd30dc0>
@pytest.mark.slow
@pytest.mark.parametrize(
"ds_generator",
[
"local_ds_generator",
"s3_ds_generator",
"hub_cloud_ds_generator",
],
indirect=True,
)
def test_persist(ds_generator):
ds = ds_generator()
ds.create_tensor("image")
ds.image.extend(np.ones((4, 224, 224, 3)))
> ds_new = ds_generator()
deeplake/api/tests/test_api.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deeplake/tests/dataset_fixtures.py:153: in generate_hub_cloud_ds
return deeplake.dataset(hub_cloud_path, token=hub_cloud_dev_token, **kwargs)
deeplake/util/spinner.py:151: in inner
return func(*args, **kwargs)
deeplake/api/dataset.py:261: in init
storage, cache_chain = get_storage_and_cache_chain(
deeplake/util/storage.py:244: in get_storage_and_cache_chain
storage = storage_provider_from_path(
deeplake/util/storage.py:66: in storage_provider_from_path
storage = storage_provider_from_hub_path(
deeplake/util/storage.py:164: in storage_provider_from_hub_path
url, final_creds, mode, expiration, repo = get_dataset_credentials(
deeplake/util/storage.py:141: in get_dataset_credentials
url, final_creds, mode, expiration, repo = client.get_dataset_credentials(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <deeplake.client.client.DeepLakeBackendClient object at 0x13e22ceb0>
org_id = 'testingacc2'
ds_name = 'tmp655b_test_api_test_persist-hub_cloud_ds_generator-', mode = None
db_engine = {'enabled': False}, no_cache = False
def get_dataset_credentials(
self,
org_id: str,
ds_name: str,
mode: Optional[str] = None,
db_engine: Optional[dict] = None,
no_cache: bool = False,
):
"""Retrieves temporary 12 hour credentials for the required dataset from the backend.
Args:
org_id (str): The name of the user/organization to which the dataset belongs.
ds_name (str): The name of the dataset being accessed.
mode (str, optional): The mode in which the user has requested to open the dataset.
If not provided, the backend will set mode to 'a' if user has write permission, else 'r'.
db_engine (dict, optional): The database engine args to use for the dataset.
no_cache (bool): If True, cached creds are ignored and new creds are returned. Default False.
Returns:
tuple: containing full url to dataset, credentials, mode and expiration time respectively.
Raises:
UserNotLoggedInException: When user is not authenticated
InvalidTokenException: If the specified token is invalid
TokenPermissionError: when there are permission or other errors related to token
AgreementNotAcceptedError: when user has not accepted the agreement
NotLoggedInAgreementError: when user is not authenticated and dataset has agreement which needs to be signed
"""
import json
db_engine = db_engine or {}
relative_url = GET_DATASET_CREDENTIALS_SUFFIX.format(org_id, ds_name)
try:
response = self.request(
"GET",
relative_url,
endpoint=self.endpoint(),
params={
"mode": mode,
"no_cache": no_cache,
"db_engine": json.dumps(db_engine),
},
).json()
except Exception as e:
if isinstance(e, AuthorizationException):
response_data = e.response.json()
code = response_data.get("code")
if code == 1:
agreements = response_data["agreements"]
agreements = [agreement["text"] for agreement in agreements]
raise AgreementNotAcceptedError(agreements) from e
elif code == 2:
raise NotLoggedInAgreementError from e
else:
try:
jwt.decode(self.token, options={"verify_signature": False})
except Exception:
> raise InvalidTokenException
E deeplake.util.exceptions.InvalidTokenException: Token is invalid. Make sure the full token string is included and try again.
deeplake/client/client.py:220: InvalidTokenException
Check failure on line 1 in deeplake/core/vectorstore/deep_memory/test_deepmemory.py
github-actions / JUnit Test Report
test_deepmemory.test_deepmemory_evaluate_without_embedding_function
failed on setup with "deeplake.util.exceptions.AuthenticationException: Authentication failed. Please try logging in again."
Raw output
request = <SubRequest 'corpus_query_relevances_copy' for <Function test_deepmemory_evaluate_without_embedding_function>>
hub_cloud_dev_token = 'eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJpZCI6InRlc3RpbmdhY2MyIiwiYXBpX2tleSI6IjU4Y0tLb1p6UE1BbThPU2RpbTRiZ2tBekhWekt1VUE3MFJpNTNyZUpKRTJuaiJ9.'
@pytest.fixture
def corpus_query_relevances_copy(request, hub_cloud_dev_token):
if not is_opt_true(request, HUB_CLOUD_OPT):
pytest.skip(f"{HUB_CLOUD_OPT} flag not set")
return
corpus = _get_storage_path(request, HUB_CLOUD)
query_vs = VectorStore(
path=f"hub://{HUB_CLOUD_DEV_USERNAME}/deepmemory_test_queries",
runtime={"tensor_db": True},
token=hub_cloud_dev_token,
)
queries = query_vs.dataset.text.data()["value"]
relevance = query_vs.dataset.metadata.data()["value"]
relevance = [rel["relevance"] for rel in relevance]
> deeplake.deepcopy(
f"hub://{HUB_CLOUD_DEV_USERNAME}/test-deepmemory10",
corpus,
token=hub_cloud_dev_token,
overwrite=True,
runtime={"tensor_db": True},
)
deeplake/tests/path_fixtures.py:491:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
deeplake/api/dataset.py:1485: in deepcopy
ret._register_dataset()
deeplake/core/dataset/deeplake_cloud_dataset.py:87: in _register_dataset
self.client.create_dataset_entry(
deeplake/client/client.py:246: in create_dataset_entry
response = self.request(
deeplake/client/client.py:148: in request
check_response_status(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [401]>
def check_response_status(response: requests.Response):
"""Check response status and throw corresponding exception on failure."""
code = response.status_code
if code >= 200 and code < 300:
return
try:
message = response.json()["description"]
except Exception:
message = " "
if code == 400:
raise BadRequestException(message)
elif response.status_code == 401:
> raise AuthenticationException
E deeplake.util.exceptions.AuthenticationException: Authentication failed. Please try logging in again.
deeplake/client/utils.py:58: AuthenticationException
Check failure on line 1097 in deeplake/core/transform/test_transform.py
github-actions / JUnit Test Report
test_transform.test_tensor_dataset_memory_leak
assert 6 == 0
Raw output
local_ds = Dataset(path='./hub_pytest/test_transform/test_tensor_dataset_memory_leak', tensors=['image'])
@pytest.mark.slow
def test_tensor_dataset_memory_leak(local_ds):
local_ds.create_tensor("image", htype="image", sample_compression="png")
add_images().eval(list(range(100)), local_ds, scheduler="threaded")
n = retrieve_objects_from_memory()
> assert n == 0
E assert 6 == 0
deeplake\core\transform\test_transform.py:1097: AssertionError
Check failure on line 12 in deeplake/util/tests/test_token.py
github-actions / JUnit Test Report
test_token.test_expiry
AssertionError: assert False
+ where False = is_expired_token({'Authorization': 'Bearer 12345', 'expires_at': 1716609209.6814132})
Raw output
@pytest.mark.slow
def test_expiry():
creds = {"Authorization": "Bearer 12345", "expires_in": 2}
expires_in_to_expires_at(creds)
sleep(2)
> assert is_expired_token(creds)
E AssertionError: assert False
E + where False = is_expired_token({'Authorization': 'Bearer 12345', 'expires_at': 1716609209.6814132})
deeplake\util\tests\test_token.py:12: AssertionError
Check failure on line 1097 in deeplake/core/transform/test_transform.py
github-actions / JUnit Test Report
test_transform.test_tensor_dataset_memory_leak
assert 1 == 0
Raw output
local_ds = Dataset(path='./hub_pytest/test_transform/test_tensor_dataset_memory_leak', tensors=['image'])
@pytest.mark.slow
def test_tensor_dataset_memory_leak(local_ds):
local_ds.create_tensor("image", htype="image", sample_compression="png")
add_images().eval(list(range(100)), local_ds, scheduler="threaded")
n = retrieve_objects_from_memory()
> assert n == 0
E assert 1 == 0
deeplake\core\transform\test_transform.py:1097: AssertionError