diff --git a/audb/core/define.py b/audb/core/define.py index e3e15add..73831848 100644 --- a/audb/core/define.py +++ b/audb/core/define.py @@ -48,16 +48,16 @@ class DependField: } DEPEND_FIELD_DTYPES = { - DependField.ARCHIVE: "string", + DependField.ARCHIVE: "object", DependField.BIT_DEPTH: "int32", DependField.CHANNELS: "int32", - DependField.CHECKSUM: "string", + DependField.CHECKSUM: "object", DependField.DURATION: "float64", - DependField.FORMAT: "string", + DependField.FORMAT: "object", DependField.REMOVED: "int32", DependField.SAMPLING_RATE: "int32", DependField.TYPE: "int32", - DependField.VERSION: "string", + DependField.VERSION: "object", } diff --git a/audb/core/dependencies.py b/audb/core/dependencies.py index 5628d4ba..d5eb57e2 100644 --- a/audb/core/dependencies.py +++ b/audb/core/dependencies.py @@ -307,7 +307,6 @@ def load(self, path: str): na_filter=False, dtype=dtype_mapping, ) - self._df.index = self._df.index.astype("string") def removed(self, file: str) -> bool: r"""Check if file is marked as removed. diff --git a/benchmarks/benchmark-dependency-methods.py b/benchmarks/benchmark-dependency-methods.py index e593c978..3ebf17f5 100644 --- a/benchmarks/benchmark-dependency-methods.py +++ b/benchmarks/benchmark-dependency-methods.py @@ -53,7 +53,7 @@ df[column] = df[column].astype(dtype) df.set_index("file", inplace=True) df.index.name = None - df.index = df.index.astype("string") + df.index = df.index.astype("object") df.to_pickle(data_cache) # === Create dependency object === diff --git a/tests/test_dependencies.py b/tests/test_dependencies.py index 1328a486..8e5e174c 100644 --- a/tests/test_dependencies.py +++ b/tests/test_dependencies.py @@ -52,7 +52,6 @@ def deps(): df = pd.DataFrame.from_records(ROWS) df.set_index("file", inplace=True) # Ensure correct dtype - df.index = df.index.astype("string") for name, dtype in zip( audb.core.define.DEPEND_FIELD_NAMES.values(), audb.core.define.DEPEND_FIELD_DTYPES.values(), @@ -82,7 +81,6 @@ def test_init(deps): def test_call(deps): expected_df = pd.DataFrame.from_records(ROWS).set_index("file") - expected_df.index = expected_df.index.astype("string") for name, dtype in zip( audb.core.define.DEPEND_FIELD_NAMES.values(), audb.core.define.DEPEND_FIELD_DTYPES.values(),