haystack
haystack copied to clipboard
Validation of YAML schema seems broken in PyCharm
Describe the bug It seems that the automatic yaml validation using our haystack schema is not working anymore in PyCharm I'd expect invalid params of a component to be highlighted in the editor. I am pretty certain that this was working after the initial PR(https://github.com/deepset-ai/haystack/pull/2020) back then.
The schema of the yaml is correctly recognized by PyCharm:
Expected behavior A clear and concise description of what you expected to happen.
Additional context Example pipeline:
version: 1.7.0
components: # define all the building-blocks for Pipeline
- name: DocumentStore
type: ElasticsearchDocumentStore
params:
host: localhost
- name: Retriever
type: BM25Retriever
params:
document_store: DocumentStore # params can reference other components defined in the YAML
top_k: 5
this should: not work
- name: Generator
type: OpenAIAnswerGenerator
params:
api_key: some
temperature: 0
max_tokens: 15
blub: test
- name: TextFileConverter
type: NodeThatNotExists
FAQ Check
- [x] Have you had a look at our new FAQ page?
System:
- OS: Ubuntu
- Haystack version (commit or version number): 1.7.1
Note: validation works as expected in my env, so it shouldn't be an obvious bug
- OSX 12.5
- VSCode 1.70 + YAML v1.9.1
- Haystack 1.7.1
Maybe just a PyCharm issue then :thinking: . Could someone else with PyCharm try this one out?
This seems to be a PyCharm issue (see here for the corresponding issue).
A workaround is to manually choose the schema file for the version you are working with:
Then, automatic schema validation seems to work fine:
Given that this seems to be a PyCharm specific issue, I'll close this one for now.