Skip to content

Commit

Permalink
cast url to string
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Feb 1, 2024
1 parent f512b57 commit 2bedbfd
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions easyDataverse/dataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ def _connect(self) -> None:
"The Dataverse installation is not compatible with easyDataverse. Please use a Dataverse installation >= 5.13.x"
)

dataset = Dataset(API_TOKEN=str(self.api_token), DATAVERSE_URL=self.server_url)
dataset = Dataset(
API_TOKEN=str(self.api_token),
DATAVERSE_URL=str(self.server_url),
)

block_names = gather_metadatablock_names(str(self.server_url))
all_blocks = asyncio.run(
fetch_metadatablocks(
Expand Down Expand Up @@ -278,7 +282,10 @@ def _fetch_dataset(
version = "latest"

endpoint = f"/api/datasets/:persistentId/?persistentId={pid}"
url = parse.urljoin(self.server_url, endpoint) # type: ignore
url = parse.urljoin(
str(self.server_url),
endpoint,
) # type: ignore
header = {}

if self.api_token is not None:
Expand All @@ -299,9 +306,14 @@ def _fetch_files(
"""Fetches all files of a dataset."""

if self.api_token:
data_api = DataAccessApi(self.server_url, str(self.api_token))
data_api = DataAccessApi(
str(self.server_url),
str(self.api_token),
)
else:
data_api = DataAccessApi(self.server_url)
data_api = DataAccessApi(
str(self.server_url),
)

download_files(
data_api,
Expand Down

0 comments on commit 2bedbfd

Please sign in to comment.