Skip to content

Commit

Permalink
fix: elasticsearch form schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fspot committed Mar 14, 2024
1 parent 122108d commit d277250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### 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
Expand Down
8 changes: 4 additions & 4 deletions toucan_connectors/elasticsearch/elasticsearch_connector.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d277250

Please sign in to comment.