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")