Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make audbcards independent from the used backend #4

Closed
hagenw opened this issue Mar 31, 2023 · 7 comments · Fixed by #44
Closed

Make audbcards independent from the used backend #4

hagenw opened this issue Mar 31, 2023 · 7 comments · Fixed by #44

Comments

@hagenw
Copy link
Member

hagenw commented Mar 31, 2023

At the moment we support only Artifactory as a backend as audfactory is used in Dataset.publication:

@property
def publication(self) -> str:
r"""Date and author uploading dataset to repository."""
url = (
f'{self.host}/{self.repository}/{self.name}/'
f'db/{self.version}/db-{self.version}.zip'
)
path = audfactory.path(url)
stat = path.stat()
return f'{stat.ctime:%Y-%m-%d} by {stat.created_by}'

and Dataset.repository_link also hard codes an Artifactory server address:

@property
def repository_link(self) -> str:
r"""Repository name with link to dataset in Artifactory web UI."""
url = (
f'{self.host}/'
f'webapp/#/artifacts/browse/tree/General/'
f'{self.repository}/'
f'{self.name}'
)
return f'`{self.repository} <{url}>`__'

@hagenw
Copy link
Member Author

hagenw commented Mar 31, 2023

To be able to still get information on author and date of publishing a database, I created audeering/audbackend#75 to support these for all backends.

/cc @Bahaabrougui

@hagenw
Copy link
Member Author

hagenw commented Mar 31, 2023

Until audbackend is updated it might be that we have to skip Dataset.publication in the tests as it would make sense to use file-system based repository that is created on the fly in the tests.

@ChristianGeng
Copy link
Member

I have used a dirty patch to circumvent the absence of publication here:

https://github.com/audeering/audbcards/pull/13/files#diff-9048213c5451377dd8ab1245088059131295d6a961d2f7bd2bb7017f2b572c7f:~:text=stat%20%3D%20path,return%20publication

So if this could be implemented, the ugliness of the above patch could also be remedied.

@hagenw
Copy link
Member Author

hagenw commented May 4, 2023

In audbackend we have now added audbackend.Backend.owner() (== author) in audeering/audbackend#127 and are going to add audbackend.Backend.date() in audeering/audbackend#128, which means in the future those will be available independent of the backend. But as these are added to a version of audbackend that has breaking changes it might take some time until they will arrive in audb.

Until then it seems valid to me to add something like if self.repository.backend == 'file-system': to provide a workaround so we also have something there in the tests for the file-system backend.

@hagenw
Copy link
Member Author

hagenw commented May 4, 2023

The same we could do for repository_link, e.g. just skip the link

if self.repository.backend == 'file-system':
    return self.repository}

@ChristianGeng
Copy link
Member

ChristianGeng commented May 4, 2023

So you say that for the time being, conditional execution depending on the backend type is ok, and the changes to audbackend are on their way, but patience is required, and no need to take initiative.

@hagenw
Copy link
Member Author

hagenw commented May 4, 2023

Yes, exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants