haystack icon indicating copy to clipboard operation
haystack copied to clipboard

fix: Fix `NamedEntityExtractor` crashing in Python 3.12 if constructed using a string backend argument

Open silvanocerza opened this issue 1 year ago • 1 comments

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

silvanocerza avatar May 24 '24 13:05 silvanocerza

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 Coverage Status
Change from base Build 9212041025: 0.001%
Covered Lines: 6693
Relevant Lines: 7388

💛 - Coveralls

coveralls avatar May 24 '24 13:05 coveralls