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

feat: add multi label selection question to the API #3010

Merged
merged 25 commits into from
May 31, 2023

Conversation

gabrielmbmb
Copy link
Member

@gabrielmbmb gabrielmbmb commented May 29, 2023

Description

I've added the required class MultiLabelSelectionQuestionSettings to create the new type of question multi-label selection question (also known as a multi-choice question) and to validate the responses submitted for this kind of question.

Also, I've removed the parametrization of the test_create_record_response_with_extra_question_responses unit test that I'd added in #3005 accidentally because I thought the validation of this depended on the question itself.

Closes #2996

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

I've created some unit tests to test the creation of this new type of question and also to validate the responses submitted to it.

Checklist

  • I have merged the original branch into my forked branch
  • I added relevant documentation
  • follows the style guidelines of this project
  • I did a self-review of my code
  • I made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

gabrielmbmb and others added 22 commits May 26, 2023 21:17
)

# Description

This PR adds a param `use_markdown` to the `TextFieldSettings` and
`TextQuestionSettings` classes in API to enable markdown support. By
default, the parameter is disabled, which is compatible with the
previous behavior.


Also, some tests creating dataset fields and questions have been grouped
using the `pytest.mark.parameterize` decorator, since the internal
behavior was the same.

Refs #2998 

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [x] Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

New tests have been created 


**Checklist**

- [x] I have merged the original branch into my forked branch
- [ ] I added relevant documentation
- [x] follows the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: gabrielmbmb <[email protected]>
@gabrielmbmb gabrielmbmb added type: enhancement Indicates new feature requests area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints labels May 29, 2023
@gabrielmbmb gabrielmbmb added this to the v1.9.0 milestone May 29, 2023
@gabrielmbmb gabrielmbmb marked this pull request as ready for review May 29, 2023 15:30
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (df39ca7) 92.92% compared to head (65c22ae) 92.93%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3010   +/-   ##
========================================
  Coverage    92.92%   92.93%           
========================================
  Files          204      204           
  Lines        10820    10833   +13     
========================================
+ Hits         10055    10068   +13     
  Misses         765      765           
Flag Coverage Δ
pytest 92.93% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/argilla/server/models/questions.py 98.18% <100.00%> (+0.45%) ⬆️
src/argilla/server/schemas/v1/datasets.py 100.00% <100.00%> (ø)
src/argilla/server/search_engine.py 93.65% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@frascuchon frascuchon left a comment

Choose a reason for hiding this comment

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

👍

@frascuchon frascuchon merged commit d56a177 into develop May 31, 2023
@frascuchon frascuchon deleted the feat/multi-label-selection-question-api branch May 31, 2023 08:28
alvarobartt added a commit that referenced this pull request Jun 8, 2023
…3100)

# Description

This PR adds support to the recently included `LabelSelectionQuestion`
and `MultiLabelSelectionQuestion` new types of questions as of #3005 and
#3010, respectively, in the Python client side.

Closes #3099 

**Type of change**

- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [x] Add integration tests for the recently included questions

**Checklist**

- [X] I have merged the original branch into my forked branch
- [X] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints type: enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create multi-choice API setting class
2 participants