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

refactor: Change no_answer attribute #3411

Merged
merged 10 commits into from
Oct 25, 2022
Merged

refactor: Change no_answer attribute #3411

merged 10 commits into from
Oct 25, 2022

Conversation

anakin87
Copy link
Member

Related Issues

Proposed Changes:

Make answer validation always run, when instantiating a Label,
as suggested by @wochinge in #3181.

How did you test it?

  • CI
  • Added a test for a Label with invalid answer

Checklist

@anakin87 anakin87 marked this pull request as ready for review October 18, 2022 21:05
@anakin87 anakin87 requested a review from a team as a code owner October 18, 2022 21:05
@anakin87 anakin87 requested review from ZanSara and removed request for a team October 18, 2022 21:05
@anakin87 anakin87 marked this pull request as draft October 18, 2022 21:31
@anakin87 anakin87 marked this pull request as ready for review October 18, 2022 21:31
@anakin87 anakin87 marked this pull request as draft October 18, 2022 22:02
@anakin87 anakin87 marked this pull request as ready for review October 18, 2022 22:02
haystack/schema.py Outdated Show resolved Hide resolved
@ZanSara ZanSara added the type:refactor Not necessarily visible to the users label Oct 24, 2022
@anakin87 anakin87 marked this pull request as draft October 24, 2022 17:35
@anakin87 anakin87 marked this pull request as ready for review October 24, 2022 18:28
@anakin87 anakin87 changed the title fix: Always run Label answer validation refactor: Change no_answer attribute Oct 24, 2022
@anakin87
Copy link
Member Author

Apparently, this modification is breaking fewer things/tests than I thought.

@ZanSara:

  • Do you see any risky code changes?
  • Do you have any tests in mind to add?

Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

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

Hey @anakin87! I had a look and I'm really happy about this one. It's crazy how much useless code you removed already 🤩

No need to go ahead and remove no_answer for good: this is already totally worth merging as it is.

I don't see any dangerous change to be honest, especially because the value itself is still there in form of a property, so it's way less prone to break things. I also don't believe we need any tests for such a simple property.

I'll open a new issue with the details of what needs to be done to get rid of the property in the future. I'll tag you just to let you add any insights you might have, and if you want, to assist the next contributor that wants to test themselves with a big PR 😊

@ZanSara ZanSara merged commit 54ec13e into deepset-ai:main Oct 25, 2022
@anakin87
Copy link
Member Author

anakin87 commented Oct 25, 2022

@ZanSara It's always a pleasure to remove (hopefully) unnecessary code. 🙂

I'm just wondering: how are the guides in the documents updated?
I can find pages like this, where no_answer is used in the initialization of the Label...

@anakin87 anakin87 deleted the always_run_Label_answer_validation branch October 25, 2022 12:18
@ZanSara
Copy link
Contributor

ZanSara commented Nov 2, 2022

Hey great question! 😄 Let me ask @brandenchan or @TuanaCelik

@brandenchan
Copy link
Contributor

Hey, we've migrated the docs away from GitHub and are now a managed service called Readme. If you see something that can be changed, you can suggest it with the "Suggest Edits" button that is in the top right underneath the search bar

@ZanSara
Copy link
Contributor

ZanSara commented Nov 2, 2022

image (5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:refactor Not necessarily visible to the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label skips answer validation if no_answer=None
3 participants