diff --git a/CHANGELOG.md b/CHANGELOG.md index a62eb42b8..e6e54ef94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## [6.1.1] 2024-03-18 + +### Fixed + +- Elasticsearch: force `widget="json"` on `body` so the form is properly filled when updating a data source + ## [6.1.0] 2024-03-13 ### Changed diff --git a/pyproject.toml b/pyproject.toml index cbaf490e3..c6d21ead3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "toucan-connectors" -version = "6.1.0" +version = "6.1.1" description = "Toucan Toco Connectors" authors = ["Toucan Toco "] license = "BSD" diff --git a/sonar-project.properties b/sonar-project.properties index 3af682a20..1ab371eed 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=toucantoco # This is the name and version displayed in the SonarCloud UI. sonar.projectName=Toucan Connectors -sonar.projectVersion=6.1.0 +sonar.projectVersion=6.1.1 sonar.python.version=3.11 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. diff --git a/toucan_connectors/elasticsearch/elasticsearch_connector.py b/toucan_connectors/elasticsearch/elasticsearch_connector.py index 16b5560d5..c2e4a7983 100644 --- a/toucan_connectors/elasticsearch/elasticsearch_connector.py +++ b/toucan_connectors/elasticsearch/elasticsearch_connector.py @@ -1,6 +1,6 @@ from copy import deepcopy from enum import Enum -from typing import List, Union +from typing import List from urllib.parse import urlparse import pandas as pd @@ -112,9 +112,9 @@ class SearchMethod(str, Enum): class ElasticsearchDataSource(ToucanDataSource): - search_method: SearchMethod - index: str = None - body: Union[dict, list] + search_method: SearchMethod = Field(SearchMethod.search, title="Search method") + index: str | None = Field(None, title="Index") + body: dict | list = Field({}, description="Body of elasticsearch query", widget="json") class ElasticsearchConnector(ToucanConnector, data_source_model=ElasticsearchDataSource):