Skip to content

Commit

Permalink
feat: add sg prefix
Browse files Browse the repository at this point in the history
All indices are prefixed with nhm- and this needs to be reflected!
  • Loading branch information
jrdh committed Sep 24, 2024
1 parent 10e792c commit e428d0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dataimporter/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ def __init__(self, config: Config):
self.views_path / "artefact",
ecatalogue_store,
image_view,
config.artefact_id,
f"{config.sg_prefix}{config.artefact_id}",
)
indexlot_view = IndexLotView(
self.views_path / "indexlot",
ecatalogue_store,
image_view,
taxonomy_view,
config.indexlot_id,
f"{config.sg_prefix}{config.indexlot_id}",
)
mammal_part_view = MammalPartView(
self.views_path / "mammalpart", ecatalogue_store
Expand All @@ -114,13 +114,13 @@ def __init__(self, config: Config):
taxonomy_view,
gbif_view,
mammal_part_view,
config.specimen_id,
f"{config.sg_prefix}{config.specimen_id}",
)
prep_view = PreparationView(
self.views_path / "preparation",
ecatalogue_store,
specimen_view,
config.preparation_id,
f"{config.sg_prefix}{config.preparation_id}",
)
self.views = [
image_view,
Expand Down
1 change: 1 addition & 0 deletions dataimporter/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Config:
artefact_id: str
indexlot_id: str
preparation_id: str
sg_prefix: str
iiif_base_url: str
mongo_config: MongoConfig
es_config: ElasticsearchConfig
Expand Down
2 changes: 2 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_str_paths_become_paths(self):
MagicMock(),
MagicMock(),
MagicMock(),
MagicMock(),
)

assert isinstance(config.data_path, Path)
Expand All @@ -62,6 +63,7 @@ def test_get_clients(self):
MagicMock(),
MagicMock(),
MagicMock(),
MagicMock(),
MongoConfig(),
ElasticsearchConfig(),
MagicMock(),
Expand Down
1 change: 1 addition & 0 deletions tests/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def config(tmp_path: Path) -> Config:
artefact_id="artefact-id",
indexlot_id="indexlot-id",
preparation_id="preparation-id",
sg_prefix="test-",
iiif_base_url="https://not.a.real.domain.com/media",
mongo_config=mongo_config,
es_config=elasticsearch_config,
Expand Down

0 comments on commit e428d0e

Please sign in to comment.