Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: elasticsearch form schema [TCTC-8032] #1580

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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