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

Loading database can fail if a previous version was published in a different repository #233

Open
frankenjoe opened this issue Oct 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@frankenjoe
Copy link
Collaborator

frankenjoe commented Oct 19, 2022

When loading a database with audb.load() we currently check the repository in which the requested version was found. Loading files from a previous version published in a different repository (which is generally supported), will therefore fail. Here's a minimal example to reproduce the issue:

import audb
import audformat



repo1 = audb.Repository(
    'local',
    'host1',
    'file-system',
)
repo2 = audb.Repository(
    'local',
    'host2',
    'file-system',
)
audb.config.REPOSITORIES = [repo1, repo2]

db = audformat.testing.create_db(minimal=True)
db['table1'] = audformat.Table()
db.save('1.0.0')

audb.publish(
    '1.0.0',
    '1.0.0',
    repo1,
    cache_root='cache',
)

db = audb.load_to(
    '2.0.0',
    db.name,
    cache_root='cache',
    only_metadata=True,
)
db['table2'] = audformat.Table()
db.save('2.0.0')

audb.publish(
    '2.0.0',
    '2.0.0',
    repo2,
    cache_root='cache',
    previous_version='1.0.0',
)

audb.load(db.name)
KeyError: 'db.table1.csv'

To solve the issue we should also check the other repositories of audb.config.REPOSITORIES if a file is not found in the repository of the requested version.

@frankenjoe frankenjoe added the bug Something isn't working label Oct 19, 2022
@frankenjoe frankenjoe changed the title Loading database can fail if pervious versions were published under a different repo Loading database can fail if a previous version was published in a different repo Oct 19, 2022
@frankenjoe frankenjoe changed the title Loading database can fail if a previous version was published in a different repo Loading database can fail if a previous version was published in a different repository Oct 19, 2022
This was referenced Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant