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

Fuzzy matching won't return multiple exact matches. #129

Open
cameron-toy opened this issue Apr 8, 2020 · 3 comments
Open

Fuzzy matching won't return multiple exact matches. #129

cameron-toy opened this issue Apr 8, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@cameron-toy
Copy link
Collaborator

cameron-toy commented Apr 8, 2020

@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

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:

Screenshot

Desktop (please complete the following information):

  • OS: macOS 10.15.3
@cameron-toy cameron-toy added the bug Something isn't working label Apr 8, 2020
@cameron-toy cameron-toy mentioned this issue Apr 8, 2020
11 tasks
@zpdeng
Copy link
Collaborator

zpdeng commented Apr 26, 2020

Some of the ProfessorSectionView data seems to be missing in the database session initialized with SQLAlchemy. It retrieves 69 rows of data instead of 339 available. Might be an issue with the MySQL View and needs to be updated?

@cameron-toy
Copy link
Collaborator Author

@zpdeng Great catch Allen. I believe that has something to do with the primary key column id not being unique for all the entries. I'll tell you when I reindex or change the primary key column and it should work then.

@adamperlin
Copy link
Contributor

Hey sorry I didn't chime in earlier - I've been very busy with class this quarter. Is my help needed with this issue at all or did it get resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants