From 886ccb4b3d4e85ff3b7ccf98c0b7d7fdcb2ba453 Mon Sep 17 00:00:00 2001 From: Anton Kukushkin Date: Wed, 12 Apr 2023 11:01:19 +0100 Subject: [PATCH] Fix opensearch mapping update error --- tests/unit/test_opensearch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/test_opensearch.py b/tests/unit/test_opensearch.py index fdc2be13b..0dfad09b2 100644 --- a/tests/unit/test_opensearch.py +++ b/tests/unit/test_opensearch.py @@ -462,6 +462,11 @@ def test_index_csv_local(client): file_path = f"{tempfile.gettempdir()}/inspections.csv" index = f"test_index_csv_local_{_get_unique_suffix()}" try: + wr.opensearch.create_index( + client=client, + index=index, + mappings={"properties": {"business_phone_number": {"type": "text"}}}, + ) df = pd.DataFrame(inspections_documents) df.to_csv(file_path, index=False) response = wr.opensearch.index_csv(client, path=file_path, index=index) @@ -474,6 +479,11 @@ def test_index_csv_s3(client, path): file_path = f"{tempfile.gettempdir()}/inspections.csv" index = f"test_index_csv_s3_{_get_unique_suffix()}" try: + wr.opensearch.create_index( + client=client, + index=index, + mappings={"properties": {"business_phone_number": {"type": "text"}}}, + ) df = pd.DataFrame(inspections_documents) df.to_csv(file_path, index=False) s3 = boto3.client("s3")