Skip to content

Commit e428d0e

Browse files
committed
feat: add sg prefix
All indices are prefixed with nhm- and this needs to be reflected!
1 parent 10e792c commit e428d0e

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

dataimporter/importer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ def __init__(self, config: Config):
9595
self.views_path / "artefact",
9696
ecatalogue_store,
9797
image_view,
98-
config.artefact_id,
98+
f"{config.sg_prefix}{config.artefact_id}",
9999
)
100100
indexlot_view = IndexLotView(
101101
self.views_path / "indexlot",
102102
ecatalogue_store,
103103
image_view,
104104
taxonomy_view,
105-
config.indexlot_id,
105+
f"{config.sg_prefix}{config.indexlot_id}",
106106
)
107107
mammal_part_view = MammalPartView(
108108
self.views_path / "mammalpart", ecatalogue_store
@@ -114,13 +114,13 @@ def __init__(self, config: Config):
114114
taxonomy_view,
115115
gbif_view,
116116
mammal_part_view,
117-
config.specimen_id,
117+
f"{config.sg_prefix}{config.specimen_id}",
118118
)
119119
prep_view = PreparationView(
120120
self.views_path / "preparation",
121121
ecatalogue_store,
122122
specimen_view,
123-
config.preparation_id,
123+
f"{config.sg_prefix}{config.preparation_id}",
124124
)
125125
self.views = [
126126
image_view,

dataimporter/lib/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Config:
4040
artefact_id: str
4141
indexlot_id: str
4242
preparation_id: str
43+
sg_prefix: str
4344
iiif_base_url: str
4445
mongo_config: MongoConfig
4546
es_config: ElasticsearchConfig

tests/test_config.py

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_str_paths_become_paths(self):
4848
MagicMock(),
4949
MagicMock(),
5050
MagicMock(),
51+
MagicMock(),
5152
)
5253

5354
assert isinstance(config.data_path, Path)
@@ -62,6 +63,7 @@ def test_get_clients(self):
6263
MagicMock(),
6364
MagicMock(),
6465
MagicMock(),
66+
MagicMock(),
6567
MongoConfig(),
6668
ElasticsearchConfig(),
6769
MagicMock(),

tests/test_importer.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def config(tmp_path: Path) -> Config:
4141
artefact_id="artefact-id",
4242
indexlot_id="indexlot-id",
4343
preparation_id="preparation-id",
44+
sg_prefix="test-",
4445
iiif_base_url="https://not.a.real.domain.com/media",
4546
mongo_config=mongo_config,
4647
es_config=elasticsearch_config,

0 commit comments

Comments
 (0)