Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev-integrate
  • Loading branch information
yuanzhou committed Jul 18, 2024
2 parents da1c324 + 4834d55 commit 71087bc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
* @yuanzhou
src/search-schema/data/definitions @AlanSimmons @yuanzhou

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.0
3.4.1
7 changes: 6 additions & 1 deletion src/hubmap_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(self, indices, app_client_id, app_client_secret, token, ontology_ap
self.INDICES: dict = {'default_index': self.DEFAULT_INDEX_WITHOUT_PREFIX, 'indices': self.indices}
self.DEFAULT_ENTITY_API_URL = self.INDICES['indices'][self.DEFAULT_INDEX_WITHOUT_PREFIX]['document_source_endpoint'].strip('/')
self._ontology_api_base_url = ontology_api_base_url
self.es_retry_on_conflict_param_value = indices['es_retry_on_conflict_param_value']

self.indexer = Indexer(self.indices, self.DEFAULT_INDEX_WITHOUT_PREFIX)

Expand Down Expand Up @@ -374,6 +375,7 @@ def _directly_modify_related_entities( self, es_url:str, es_index:str, entity_i
f' \"lang\": \"painless\",' \
f' \"source\": \"{painless_query}\",' \
f' \"params\": {{' \
f' \"retry_on_conflict\": {self.es_retry_on_conflict_param_value},' \
f' \"modified_entity_uuid\": \"<TARGET_MODIFIED_ENTITY_UUID>\",' \
f' \"revised_related_entity\": <THIS_REVISED_ENTITY>' \
f' }}' \
Expand Down Expand Up @@ -414,7 +416,10 @@ def _directly_modify_related_entities( self, es_url:str, es_index:str, entity_i
f" es_url={es_url},"
f" endoint '_update/{related_entity_id}' with"
f" qdsl_update_payload_string={qdsl_update_payload_string}.")
raise Exception(f"OpenSearch query return a status code of "
if opensearch_response.text:
logger.error(f"OpenSearch message for {opensearch_response.status_code} code:"
f" '{opensearch_response.text}'.")
raise Exception(f"OpenSearch query returned a status code of "
f" '{opensearch_response.status_code}'. See logs.")
elif opensearch_response.status_code == 404:
logger.info(f"Call to QDSL _update got HTTP response code"
Expand Down
2 changes: 2 additions & 0 deletions src/instance/search-config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
ingest_api_soft_assay_url: https://ingest-api.dev.hubmapconsortium.org/assaytype/
# default index name for endpoints that don't specify an index
default_index: entities
# ElasticSearch retry_on_conflict value. Positive integer or zero.
es_retry_on_conflict_param_value: 5

# specify multiple indices
indices:
Expand Down
2 changes: 1 addition & 1 deletion src/search-adaptor
Submodule search-adaptor updated 1 files
+1 −1 VERSION

0 comments on commit 71087bc

Please sign in to comment.