haystack
haystack copied to clipboard
fix: Fix `NamedEntityExtractor` crashing in Python 3.12 if constructed using a string backend argument
Proposed Changes:
Change NamedEntityExtractorBackend to better handle conversion of strings to enum values.
This fixes a crash in NamedEntityExtractor when using a string as backend argument when creating the Component in Python 3.12.
How did you test it?
I ran tests locally using Python 3.12.
Notes for the reviewer
CI doesn't run tests using Python 3.8 so this won't fail, I recommend running tests locally with Python 3.12 just to be sure.
Checklist
- I have read the contributors guidelines and the code of conduct
- I have updated the related issue with new insights and changes
- I added unit tests and updated the docstrings
- I've used one of the conventional commit types for my PR title:
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:. - I documented my code
- I ran pre-commit hooks and fixed any issue
Pull Request Test Coverage Report for Build 9224618689
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- 31 unchanged lines in 1 file lost coverage.
- Overall coverage increased (+0.001%) to 90.593%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| components/extractors/named_entity_extractor.py | 31 | 68.86% |
| <!-- | Total: | 31 |
| Totals | |
|---|---|
| Change from base Build 9212041025: | 0.001% |
| Covered Lines: | 6693 |
| Relevant Lines: | 7388 |