From 7ae5eeb311ab792b3e40d75eaceb1afa74d01053 Mon Sep 17 00:00:00 2001 From: Tonio Fincke Date: Wed, 24 Mar 2021 10:06:05 +0100 Subject: [PATCH] xcube-cds 46: return values as correct type (str, not type specifier) --- CHANGES.md | 2 ++ test/test_store.py | 6 ++++-- xcube_cds/store.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b329dc8..f9e5ad6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ ## Changes in 0.8.0 (in development) +* Store methods *get_type_specifier* and *get_type_specifiers_for_data* now return + values in correct format (strings instead of type specifiers) * Provided xcube data store framework interface compatibility with breaking changes in xcube 0.8.0 (see https://github.com/dcs4cop/xcube/issues/420). diff --git a/test/test_store.py b/test/test_store.py index 7d312a9..88e77f1 100644 --- a/test/test_store.py +++ b/test/test_store.py @@ -134,8 +134,10 @@ def test_get_data_store_params_schema(self): }, CDSDataStore.get_data_store_params_schema().to_dict()) def test_get_type_specifiers(self): - self.assertTupleEqual((TYPE_SPECIFIER_CUBE, ), - CDSDataStore.get_type_specifiers()) + type_specifiers = CDSDataStore.get_type_specifiers() + self.assertEqual(1, len(type_specifiers)) + self.assertIsInstance(type_specifiers[0], str) + self.assertTupleEqual(('dataset[cube]',), type_specifiers) def test_has_data_false(self): self.assertFalse(CDSDataStore().has_data('nonexistent data ID')) diff --git a/xcube_cds/store.py b/xcube_cds/store.py index 9ad800c..675a19e 100644 --- a/xcube_cds/store.py +++ b/xcube_cds/store.py @@ -751,11 +751,11 @@ def get_data_store_params_schema(cls) -> JsonObjectSchema: @classmethod def get_type_specifiers(cls) -> Tuple[str, ...]: - return TYPE_SPECIFIER_CUBE, + return str(TYPE_SPECIFIER_CUBE), def get_type_specifiers_for_data(self, data_id: str) -> Tuple[str, ...]: self._validate_data_id(data_id) - return TYPE_SPECIFIER_CUBE, + return str(TYPE_SPECIFIER_CUBE), def get_data_ids(self, type_specifier: Optional[str] = None, include_attrs: Container[str] = None) -> \