Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abandon YAML for indexing, using UBKG #50

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.23
1.0.24
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ def create_request_headers_for_auth(self, token):

def init_translator(self, token):
if self.ubkg_instance is None:
return self.translator_module.Translator(self.INDICES, self.APP_CLIENT_ID, self.APP_CLIENT_SECRET, token)
return self.translator_module.Translator(self.INDICES, self.APP_CLIENT_ID, self.APP_CLIENT_SECRET, token, self.ONTOLOGY_API_BASE_URL)
return self.translator_module.Translator(self.INDICES, self.APP_CLIENT_ID, self.APP_CLIENT_SECRET, token, self.ubkg_instance)

# Get a list of filtered Elasticsearch indices to expose to end users without the prefix
Expand Down
29 changes: 0 additions & 29 deletions src/translator/tranlation_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,6 @@ def get_all_reindex_enabled_indice_names(all_indices):

return all_names


def get_type_description(type_code, type_yaml_file_name):
filename = 'search-schema/data/definitions/enums/' + type_yaml_file_name + '.yaml'
type_yaml_file = Path(
__file__).absolute().parent.parent.parent.parent / filename

logger.debug(f"========type_code: {type_code}")

with open(type_yaml_file) as file:
definition_dict = yaml.safe_load(file)

logger.info(f"Definition yaml file {type_yaml_file} loaded successfully")

if type_code in definition_dict:
definition_desc = definition_dict[type_code]['description']
else:
# Return the error message as description
msg = f"Missing definition key {type_code} in {type_yaml_file}"

logger.error(msg)

# Use triple {{{}}}
definition_desc = f"{{{type_code}}}"

logger.debug(f"========definition_desc: {definition_desc}")

return definition_desc


def remove_specific_key_entry(obj, key_to_remove=None):
if type(obj) == dict:
if key_to_remove in obj.keys():
Expand Down