diff --git a/index_configuration_tool/index_operations.py b/index_configuration_tool/index_operations.py index 40d3ad576..22385c5ad 100644 --- a/index_configuration_tool/index_operations.py +++ b/index_configuration_tool/index_operations.py @@ -9,8 +9,6 @@ __INDEX_KEY = "index" __ALL_INDICES_ENDPOINT = "*" __INTERNAL_SETTINGS_KEYS = ["creation_date", "uuid", "provided_name", "version", "store"] -__DYNAMIC_KEY = "dynamic" -__STRICT_VALUE = "strict" def fetch_all_indices(endpoint: str, optional_auth: Optional[tuple] = None, verify: bool = True) -> dict: @@ -19,15 +17,6 @@ def fetch_all_indices(endpoint: str, optional_auth: Optional[tuple] = None, veri # Remove internal settings result = dict(resp.json()) for index in result: - # TODO Remove after https://github.com/opensearch-project/data-prepper/issues/2864 is resolved - try: - dynamic_mapping_value = result[index][MAPPINGS_KEY][__DYNAMIC_KEY] - if dynamic_mapping_value == __STRICT_VALUE: - del result[index][MAPPINGS_KEY][__DYNAMIC_KEY] - except KeyError: - # One of the keys in the path above is not present, so we can - # ignore the deletion logic and execute the rest - pass for setting in __INTERNAL_SETTINGS_KEYS: index_settings = result[index][SETTINGS_KEY] if __INDEX_KEY in index_settings: diff --git a/index_configuration_tool/tests/test_constants.py b/index_configuration_tool/tests/test_constants.py index e0f041518..f54206088 100644 --- a/index_configuration_tool/tests/test_constants.py +++ b/index_configuration_tool/tests/test_constants.py @@ -38,7 +38,6 @@ } }, MAPPINGS_KEY: { - # Strict mapping should be filtered out "dynamic": "strict" } }, @@ -50,7 +49,6 @@ } }, MAPPINGS_KEY: { - "dynamic": "false", "id": {"type": "keyword"} } } diff --git a/index_configuration_tool/tests/test_index_operations.py b/index_configuration_tool/tests/test_index_operations.py index 5790b263b..0a06303f9 100644 --- a/index_configuration_tool/tests/test_index_operations.py +++ b/index_configuration_tool/tests/test_index_operations.py @@ -20,11 +20,8 @@ def test_fetch_all_indices(self): index_settings = index_data[test_constants.INDEX1_NAME][test_constants.SETTINGS_KEY] self.assertTrue(test_constants.INDEX_KEY in index_settings) self.assertEqual({"is_filtered": False}, index_settings[test_constants.INDEX_KEY]) - # Test that only strict mapping is filtered out index_mappings = index_data[test_constants.INDEX2_NAME][test_constants.MAPPINGS_KEY] - self.assertEqual(0, len(index_mappings)) - index_mappings = index_data[test_constants.INDEX3_NAME][test_constants.MAPPINGS_KEY] - self.assertEqual("false", index_mappings["dynamic"]) + self.assertEqual("strict", index_mappings["dynamic"]) @responses.activate def test_create_indices(self):