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 YAML validation for ElasticsearchDocumentStore.custom_query #2789

Merged
merged 5 commits into from Jul 12, 2022

Conversation

ZanSara
Copy link
Contributor

@ZanSara ZanSara commented Jul 11, 2022

Related Issue(s): #2754

Proposed changes:

  • Add an exception for this specific field in the validation code.
  • Introduce the possibility to list JSON fields by name and have them validated as JSON instead of strings
  • CATCH: the fields are validated by name, not by which component is trying to load them. The implementation is not very neat, better ideas are welcome.

Pre-flight checklist

Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍 It's good to have a first fix for this but I also agree that the solution is hacky because of the need to have matching names. Further, if a user wants to add a custom node that has a parameter that accepts JSON then this becomes more complex. For now, I found only this single JSON field "custom_query" when skimming through all our nodes and "custom_query" is relatively important to allow use cases that otherwise cannot be handled with the standard queries (custom filtering, etc.). So let's merge this fix! 👍

@ZanSara ZanSara merged commit 4d2a069 into master Jul 12, 2022
@ZanSara ZanSara deleted the validate_es_custom_query branch July 12, 2022 11:49
Krak91 pushed a commit to Krak91/haystack that referenced this pull request Jul 26, 2022
…epset-ai#2789)

* Add exception for  in the validation code

* Update Documentation & Code Style

* Add tests

* Update Documentation & Code Style

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants