calpoly-csai / calpoly-csai/api
Fuzzy matching won't return multiple exact matches.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
@adamperlin @mfekadu
**Describe the bug**
So first, some good news (in a bug report!): accessing views works fine. I made an SQLAlchemy object to access the Professor/Section view and get_property_from_entity() works as expected.
The bad news is that I'm currently unable to use get_property_from_entity() to answer questions like "What sections does Dr. Khosmood teach?" even with modification.
The current get_property_from_entity() returns the closest match. I made a function _get_property_from_entity() that returns the full list of matches, but if I put in "Irene Humer" as the search term I only get one match, even though she teaches multiple sections.
**How to recreate this behavior**
See the code of the latest pull request. Run "test_view_access.py"
**Expected behavior**
```python
print(db._get_property_from_entity(
"section_name",
ProfessorSectionView,
"Irene Humer"
))
```
`[(133, ['Irene ', Humer'], 'CPE 101_01), (133, ['Irene ', Humer'], 'CPE 203_03), (133, ['Irene ', Humer'], 'CPE 203_04), ... etc]`
**Screenshots**
Actual behavior:

**Desktop (please complete the following information):**
- OS: macOS 10.15.3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.