Skip to content

Error loading a cached database stored with newer pandas version #520

@audeerington

Description

@audeerington

If a database has been loaded to cache with pandas version 2.3.2 previously, e.g.

import audb

test_cache_root = "audb_cache"
audb.load("emodb", version="1.4.1", cache_root=test_cache_root, only_metadata=True)

and then one tries to load the same database with an older pandas version, e.g. 2.2.2, using the same script,
it fails with the error TypeError: StringDtype.__init__() takes from 1 to 2 positional arguments but 3 were given.

The error originates from loading a pickled dataframe, when the constructor of StringDtype is called. In version 2.3.x, the constructor has two arguments, whereas in versions 2.2.x there is only one argument .

This makes it impossible to use the same audb cache with different pandas versions - one can either manually delete the pickle files in the cache or update all environments to use the newer pandas version. This is tricky with a cache that is shared between multiple users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions