Skip to content

Commit

Permalink
Fixt style
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-s-ramirezayuso committed Feb 14, 2025
1 parent 816f6ca commit 10bb78a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions domino_data/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import backoff
import httpx
import urllib3
from domino_data.data_sources import DataSourceClient, ObjectStoreDatasource

import domino_data.configuration_gen
from domino_data.data_sources import DataSourceClient, ObjectStoreDatasource

from .auth import AuthenticatedClient, get_jwt_token
from .logging import logger
Expand Down Expand Up @@ -324,7 +324,7 @@ def list_files(
prefix=prefix,
page_size=page_size,
config={},
credential={}
credential={},
)

@backoff.on_exception(backoff.expo, UnauthenticatedError, max_time=60)
Expand All @@ -348,4 +348,10 @@ def get_file_url( # pylint: disable=too-many-arguments
"""
logger.info("get_file_url", dataset_unique_name=dataset_unique_name, file_name=file_name)

return self.datasource_client.get_key_url(datasource_id=dataset_unique_name, object_key=file_name, is_read_write=False, config={}, credential={})
return self.datasource_client.get_key_url(
datasource_id=dataset_unique_name,
object_key=file_name,
is_read_write=False,
config={},
credential={},
)
4 changes: 4 additions & 0 deletions tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from domino_data import configuration_gen as ds_gen
from domino_data import datasets as ds


# Get Dataset
@pytest.mark.vcr
def test_get_dataset():
Expand All @@ -19,6 +20,7 @@ def test_get_dataset():

assert isinstance(dataset_test, ds.Dataset)


@pytest.mark.vcr
def test_get_dataset_with_jwt(monkeypatch):
"""Client can fetch a dataset using JWT."""
Expand All @@ -30,6 +32,7 @@ def test_get_dataset_with_jwt(monkeypatch):

client.get_dataset("dataset-test")


@pytest.mark.vcr
def test_get_dataset_does_not_exist():
"""Client raises an error when dataset does not exist."""
Expand Down Expand Up @@ -105,6 +108,7 @@ def test_get_file_url():

assert "aFile" in url


@pytest.mark.vcr
def test_get_file_url_not_found():
"""Client gets an error when getting URL for a dataset that does not exist."""
Expand Down

0 comments on commit 10bb78a

Please sign in to comment.