mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-12 08:03:50 +00:00
Add custom_mapping to the list of fields that can contain string-encoded JSON (#3065)
This commit is contained in:
parent
4e518cdddd
commit
e88f1e2577
@ -97,7 +97,10 @@ def read_pipeline_config_from_yaml(path: Path) -> Dict[str, Any]:
|
|||||||
return yaml.safe_load(stream)
|
return yaml.safe_load(stream)
|
||||||
|
|
||||||
|
|
||||||
JSON_FIELDS = ["custom_query"] # ElasticsearchDocumentStore.custom_query
|
JSON_FIELDS = [
|
||||||
|
"custom_query", # ElasticsearchDocumentStore.custom_query
|
||||||
|
"custom_mapping", # ElasticsearchDocumentStore.custom_mapping
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def validate_config_strings(pipeline_config: Any):
|
def validate_config_strings(pipeline_config: Any):
|
||||||
|
|||||||
@ -687,6 +687,9 @@ def test_validate_pipeline_config_component_with_json_input_valid():
|
|||||||
validate_config_strings(
|
validate_config_strings(
|
||||||
{"components": [{"name": "test", "type": "test", "params": {"custom_query": '{"json-key": "json-value"}'}}]}
|
{"components": [{"name": "test", "type": "test", "params": {"custom_query": '{"json-key": "json-value"}'}}]}
|
||||||
)
|
)
|
||||||
|
validate_config_strings(
|
||||||
|
{"components": [{"name": "test", "type": "test", "params": {"custom_mapping": '{"json-key": "json-value"}'}}]}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_validate_pipeline_config_component_with_json_input_invalid_key():
|
def test_validate_pipeline_config_component_with_json_input_invalid_key():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user