Skip to content

Empty string answers now return None 馃憤 - #199

Merged
Jason-Ku merged 1 commit into
devfrom
iss198_Empty_Answers
Sep 15, 2020
Merged

Jason-Ku merged 1 commit into
devfrom
iss198_Empty_Answers

Conversation

@ethanahlquist

Copy link
Copy Markdown
Contributor

What's New?

I added a quick check to see if the NLP returns an empty string to the answer field. Instead return 'None' when this occurs.

Fixes #198

Type of change (pick-one)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I ran the following request, which had initially contained an empty answer:

curl --location --request POST 'localhost:8080/ask' --header 'Content-Type: application/json' --data-raw '{ "question": "How would I see Dr. Ventura now?" }'

Now, it returns:

{
  "answer": "I'm sorry, I understand your question but was unable to find an answer. Please try another question.",
  "session": "SOME_NEW_TOKEN"
}

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

  • I documented my code according to the Google Python Style Guide

  • I ran ./build_docs.sh and the docs look fine

  • I ran ./type_check.sh and got no errors

  • I ran ./format.sh because it automatically cleans my code for me 馃槃

  • I ran ./lint.sh to check for what "format" missed

  • I added my tests to the /tests directory

  • I ran ./run_tests.sh and all the tests pass

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Jason-Ku Jason-Ku left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@snekiam snekiam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Jason-Ku
Jason-Ku merged commit ba143f7 into dev Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty answers for some questions

3 participants