mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-08 13:06:29 +00:00
bug: validate custom_mapping as an object (#3189)
* Validate custom_mapping properly as an object * Remove related test * black
This commit is contained in:
parent
621e1af74c
commit
96bb9b5905
@ -21,7 +21,7 @@ from haystack.errors import PipelineError, PipelineConfigError, PipelineSchemaEr
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
VALID_INPUT_REGEX = re.compile(r"^[-a-zA-Z0-9_/\\.:]+$")
|
||||
VALID_INPUT_REGEX = re.compile(r"^[-a-zA-Z0-9_/\\.:*]+$")
|
||||
VALID_ROOT_NODES = ["Query", "File"]
|
||||
|
||||
|
||||
@ -97,10 +97,7 @@ def read_pipeline_config_from_yaml(path: Path) -> Dict[str, Any]:
|
||||
return yaml.safe_load(stream)
|
||||
|
||||
|
||||
JSON_FIELDS = [
|
||||
"custom_query", # ElasticsearchDocumentStore.custom_query
|
||||
"custom_mapping", # ElasticsearchDocumentStore.custom_mapping
|
||||
]
|
||||
JSON_FIELDS = ["custom_query"] # ElasticsearchDocumentStore.custom_query
|
||||
|
||||
|
||||
def validate_config_strings(pipeline_config: Any):
|
||||
|
||||
@ -687,9 +687,6 @@ def test_validate_pipeline_config_component_with_json_input_valid():
|
||||
validate_config_strings(
|
||||
{"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():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user