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

Remove support for missing response status #4533

Closed
frascuchon opened this issue Jan 25, 2024 · 1 comment · Fixed by #4602
Closed

Remove support for missing response status #4533

frascuchon opened this issue Jan 25, 2024 · 1 comment · Fixed by #4602
Assignees
Labels
area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints team: backend Indicates that the issue or pull request is owned by the backend team type: breaking changes This issue or PR may include breaking changes in the code
Milestone

Comments

@frascuchon
Copy link
Member

See the CHANGELOG.md entry line: https://github.com/argilla-io/argilla/blob/develop/CHANGELOG.md?plain=1#L59

@frascuchon frascuchon self-assigned this Jan 25, 2024
@frascuchon frascuchon added this to the 1.24.0 milestone Jan 25, 2024
Copy link

dosubot bot commented Jan 25, 2024

🤖

Hey there, @frascuchon! Good to see you around the Argilla repo again. How's it going?

Based on the information provided in the CHANGELOG.md file, it's clear that the missing response status is deprecated and should be removed in the release v1.24.0. The missing response status is implemented in the ResponseStatusFilter Enum in the src/argilla/server/enums.py file. Here is the relevant code:

class ResponseStatusFilter(str, Enum):
    draft = "draft"
    missing = "missing"  # Deprecated, use pending instead
    pending = "pending"
    submitted = "submitted"
    discarded = "discarded"

Source: src/argilla/server/enums.py

Additionally, there is functionality in the Argilla codebase that relies on the missing response status. The response_statuses parameter in the search_dataset_records function can take a list of ResponseStatusFilter objects, which can include the missing status. This parameter is then passed to the _get_search_responses function, which uses it to filter the search responses.

Here is the relevant code:

@router.post(
    "/datasets/{dataset_id}/records/search",
    status_code=status.HTTP_200_OK,
    response_model=SearchRecordsResult,
    response_model_exclude_unset=True,
)
async def search_dataset_records(
    *,
    db: AsyncSession = Depends(get_async_db),
    search_engine: SearchEngine = Depends(get_search_engine),
    dataset_id: UUID,
    body: SearchRecordsQuery,
    metadata: MetadataQueryParams = Depends(),
    sort_by_query_param: SortByQueryParamParsed,
    include: Optional[RecordIncludeParam] = Depends(parse_record_include_param),
    response_statuses: List[ResponseStatusFilter] = Query([], alias="response_status"),
    offset: int = Query(0, ge=0),
    limit: int = Query(default=LIST_DATASET_RECORDS_LIMIT_DEFAULT, ge=1, le=LIST_DATASET_RECORDS_LIMIT_LE),
    current_user: User = Security(auth.get_current_user),
):
    ...
    search_responses = await _get_search_responses(
        db=db,
        search_engine=search_engine,
        dataset=dataset,
        search_records_query=body,
        limit=limit,
        offset=offset,
        parsed_metadata=metadata.metadata_parsed,
        response_statuses=response_statuses,
        sort_by_query_param=sort_by_query_param,
    )
    ...

Source: src/argilla/server/apis/v1/handlers/datasets/records.py

To remove the missing response status, you would need to remove it from the ResponseStatusFilter Enum and update any functionality that relies on it to use the pending status instead. Please note that as a maintainer, I can't make these changes for you. You would need to make these changes in your local environment and test them thoroughly to ensure that they don't break any existing functionality.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints team: backend Indicates that the issue or pull request is owned by the backend team type: breaking changes This issue or PR may include breaking changes in the code labels Jan 25, 2024
@nataliaElv nataliaElv modified the milestones: v1.24.0, v1.25.0 Jan 30, 2024
@frascuchon frascuchon linked a pull request Feb 26, 2024 that will close this issue
13 tasks
frascuchon added a commit that referenced this issue Feb 27, 2024
<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

This PR removes the `missing` value for response status filters in the
python SDK.

Closes [#4533](#4533)

**Type of change**

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

- [ ] New feature (non-breaking change which adds functionality)
- [X] Refactor (change restructuring the codebase without changing
functionality)
- [ ] Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] I followed 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 filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------

Co-authored-by: nataliaElv <natalia@argilla.io>
Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
davidberenstein1957 added a commit that referenced this issue Feb 27, 2024
<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

This PR removes the `missing` value for response status filters in the
python SDK.

Closes [#4533](#4533)

**Type of change**

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

- [ ] New feature (non-breaking change which adds functionality)
- [X] Refactor (change restructuring the codebase without changing
functionality)
- [ ] Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] I followed 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 filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------

Co-authored-by: nataliaElv <natalia@argilla.io>
Co-authored-by: David Berenstein <david.m.berenstein@gmail.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 team: backend Indicates that the issue or pull request is owned by the backend team type: breaking changes This issue or PR may include breaking changes in the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants