fix: handle phrases with apostrophes - #116
Conversation
|
Thanks for the pull request, @Agrendalath! I've created OSPR-6172 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
6547de3 to
9aae08a
Compare
|
@Agrendalath Thank you for your contribution. Please let me know once this is ready. |
|
👍🏽
|
|
@natabene, this is ready for your review. |
|
@Agrendalath I've added this one and https://github.com/edx/edx-platform/pull/29106 to the OSPR list. |
9aae08a to
bb2bfce
Compare
We're using shlex to split phrases. It uses the POSIX mode by default, which is throwing an exception when there are unclosed quotes in phrases. This disables the POSIX mode after an error, so the phrases can still be split correctly.
|
@natabene, just a friendly reminder about this PR. It only handles an error that occurs when there is an uneven number of quotes in a search query. |
|
@Agrendalath 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
Thanks for a quick review, @idegtiarov! |
We're using shlex to split phrases. It uses the POSIX mode by default, which is throwing an exception when there are unclosed quotes in phrases. This disables the POSIX mode after an error, so the phrases can still be split correctly.
Description
We're using shlex to split phrases. It uses the POSIX mode by default, which is throwing an exception when there are unclosed quotes in phrases. This escapes such quotes, so the phrases with apostrophes can be split correctly.
Supporting information
OSPR ticket: OSPR-6172
OpenCraft Jira ticket: BB-4994
Known issues
The ElasticSearch connection was not working for me with the most recent devstack version. I had to add this to
lms/envs/private.pyandcms/envs/private.py:Testing instructions
FEATURES['ENABLE_COURSEWARE_SEARCH']in LMS.FEATURES['ENABLE_COURSEWARE_INDEX']in Studio."should not"shouldn'tshouldn\'t"shouldn't have"shouldn\'t\'ve"shouldn't've failed"shou'dn't'veshou\'dn\'t\'ve"shou'dn't've failed"Deadline
"None"
Reviewers