From c51bccbca312a12829ebb1e3c5335a18b33d6f57 Mon Sep 17 00:00:00 2001 From: Fju Date: Thu, 24 Feb 2022 10:25:35 +0100 Subject: [PATCH 1/2] Changed dateformat to strict_date_optional_time --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index a8d1e777..c061d6a2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -64,7 +64,7 @@ "OriginRegion": {"type": "keyword"}, "OriginWeather": {"type": "keyword"}, "dayOfWeek": {"type": "byte"}, - "timestamp": {"type": "date", "format": "strict_date_hour_minute_second"}, + "timestamp": {"type": "date", "format": "strict_date_optional_time"}, } } } From f3ef72d219f1edb21bf822dc78e0736660784fe1 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 6 Nov 2023 15:52:56 +0400 Subject: [PATCH 2/2] Fix test for new timestamp type --- docs/sphinx/examples/demo_notebook.ipynb | 2 +- tests/field_mappings/test_metric_source_fields_pytest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/examples/demo_notebook.ipynb b/docs/sphinx/examples/demo_notebook.ipynb index 373a96ab..a6d02b9e 100644 --- a/docs/sphinx/examples/demo_notebook.ipynb +++ b/docs/sphinx/examples/demo_notebook.ipynb @@ -4030,7 +4030,7 @@ "Mappings:\n", " capabilities:\n", " es_field_name is_source es_dtype es_date_format pd_dtype is_searchable is_aggregatable is_scripted aggregatable_es_field_name\n", - "timestamp timestamp True date strict_date_hour_minute_second datetime64[ns] True True False timestamp\n", + "timestamp timestamp True date strict_date_optional_time datetime64[ns] True True False timestamp\n", "OriginAirportID OriginAirportID True keyword None object True True False OriginAirportID\n", "DestAirportID DestAirportID True keyword None object True True False DestAirportID\n", "FlightDelayMin FlightDelayMin True integer None int64 True True False FlightDelayMin\n", diff --git a/tests/field_mappings/test_metric_source_fields_pytest.py b/tests/field_mappings/test_metric_source_fields_pytest.py index 89510795..ad785f37 100644 --- a/tests/field_mappings/test_metric_source_fields_pytest.py +++ b/tests/field_mappings/test_metric_source_fields_pytest.py @@ -70,7 +70,7 @@ def test_flights_all_metric_source_fields_bool_and_timestamp(self): assert pd_metric.columns.to_list() == ed_fields assert len(es_date_formats) == len(ed_dtypes) assert set(es_date_formats) == set( - {"strict_date_hour_minute_second", None} + {"strict_date_optional_time", None} ) # TODO - test position of date_format def test_ecommerce_selected_non_metric_source_fields(self):