From fd45a779b831029b448767351f798d49e33df218 Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Tue, 6 Sep 2022 17:11:59 -0400 Subject: [PATCH 1/2] in check_metrics, avoid overasserting when checking `settings`, only check keys specified on the metric class (allow other settings to exist) --- elasticsearch_metrics/metrics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elasticsearch_metrics/metrics.py b/elasticsearch_metrics/metrics.py index ad29b1c..2a4af64 100644 --- a/elasticsearch_metrics/metrics.py +++ b/elasticsearch_metrics/metrics.py @@ -169,8 +169,12 @@ def check_index_template(cls, using=None): mappings_in_sync = current_data["mappings"] == template_data["mappings"] if "settings" in current_data and "index" in current_data["settings"]: - current_settings = current_data["settings"]["index"] template_settings = template_data.get("settings", {}) + current_settings = { + key: value + for key, value in current_data["settings"]["index"] + if key in template_settings + } # ES automatically casts number_of_shards and number_of_replicas to a string # so we need to cast before we compare # TODO: Are there other settings that need to be handled? From b9523eaadae8f2a5f8f45340f0f10a248ab99dbd Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Wed, 7 Sep 2022 06:38:10 -0400 Subject: [PATCH 2/2] [wip] update to elasticsearch_dsl 6.3+ --- CHANGELOG.md | 6 ++++++ elasticsearch_metrics/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c4142..8fbb1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2022.0.0 (2022-09-07) + +Switch to calendar-year major version numbers + +* Fix elasticsearch-dsl 6.3.0 incompatibility? + ## 5.0.0 (2018-11-28) Changes: diff --git a/elasticsearch_metrics/__init__.py b/elasticsearch_metrics/__init__.py index 23aad64..44c89be 100644 --- a/elasticsearch_metrics/__init__.py +++ b/elasticsearch_metrics/__init__.py @@ -3,7 +3,7 @@ from elasticsearch_dsl.connections import connections from django.utils.module_loading import autodiscover_modules -__version__ = "5.0.0" +__version__ = "2022.0.0" default_app_config = "elasticsearch_metrics.ElasticsearchMetricsConfig" diff --git a/setup.py b/setup.py index f595f81..ccc3309 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def read(fname): "metrics", "statistics", ), - install_requires=["elasticsearch-dsl>=6.0.0,<6.3.0"], + install_requires=["elasticsearch-dsl>=6.3.0,<7.0.0"], extras_require=EXTRAS_REQUIRE, classifiers=[ "Operating System :: OS Independent",