audeering / audb

Manage audio and video databases
https://audeering.github.io/audb/
Other
23 stars 1 forks source link

Fix dependency table loading from cache #417

Closed hagenw closed 1 month ago

hagenw commented 1 month ago

Closes #418

This ensures we catch all reported (and potential other) errors, when loading a dependency table from cache, by using except Exception inside audb.dependencies(). except Exception will not catch KeyboardInterupt, which is raised if a user Interrupts the program by pressing CTRL-x.

The solution is not ideal, if the cache files are not cross-platform compatible. Then every time you would load from a shared cache with another platform, it would reload the cache file from the server. But so far, we have no indication, that this is the case. E.g. all tests in https://github.com/audeering/audb/pull/413 passed on all platforms for cache files created under Linux.

This pull request also adds a test test_load_save_pandas_compatibility() to document the expected errors due to the use of different pandas versions when saving/loading to/from cache. To achieve this, I added files pre-cached by 3 different pandas versions to tests/assests/dependency-table-pandas/ together with a README and 2 script files to create those cache files.