Skip to content

Commit

Permalink
Merge pull request #47 from dcs4cop/toniof-46-return-strings
Browse files Browse the repository at this point in the history
Toniof 46 return strings
  • Loading branch information
pont-us authored Apr 9, 2021
2 parents 853eebc + 7ae5eeb commit b2ad10c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
6 changes: 4 additions & 2 deletions test/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
4 changes: 2 additions & 2 deletions xcube_cds/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> \
Expand Down

0 comments on commit b2ad10c

Please sign in to comment.