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: add ArgillaDatasetMixin and re-structure argilla.feedback.schemas #3427

Merged
merged 11 commits into from
Jul 24, 2023

Conversation

alvarobartt
Copy link
Member

Description

This PR starts off with the refactoring effort to make sure that everything's more maintainable and scalable.

So on, this PR refactors the argilla/feedback/schemas.py to be split in different files in a more organised way as argilla/feedback/schemas/*.py so that we have fields.py, questions.py and records.py to contain the main pydantic.BaseModels for those. Also all the docstrings have been rewritten from scratch to be clearer and provide more information.

Additionally, this PR also adds the ArgillaDatasetMixin to detach the Argilla-related functionality from the FeedbackDataset itself, as we recently did for the HuggingFace Hub integration (i.e. #3326)

Type of change

  • 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)

  • Add unit tests for every pydantic.BaseModel under argilla/feedback/schemas

Checklist

  • 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 filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

Additionally, I've also rewritten the docstrings to make those clearer and following a more standardized format
@davidberenstein1957 should have another look into this once he's back to add missing type-hints and refactor the unit tests for the unfication strategies, eventually to be refactored
@alvarobartt alvarobartt added this to the v1.14.0 milestone Jul 18, 2023
@alvarobartt alvarobartt marked this pull request as draft July 18, 2023 15:34
@alvarobartt alvarobartt marked this pull request as ready for review July 24, 2023 10:31
@alvarobartt alvarobartt force-pushed the refactor/schemas-and-argilla-mixin branch from afdbe77 to a2e9134 Compare July 24, 2023 12:08
Copy link
Member

@gabrielmbmb gabrielmbmb left a comment

Choose a reason for hiding this comment

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

It looks good to me. I think we can get rid of the FeedbackDataset.__del__ method and when fetching the records, I think we don't need to fetch the first batch outside of the loop.

@gabrielmbmb gabrielmbmb merged commit e124566 into develop Jul 24, 2023
@gabrielmbmb gabrielmbmb deleted the refactor/schemas-and-argilla-mixin branch July 24, 2023 13:14
leiyre pushed a commit that referenced this pull request Aug 1, 2023
…rgilla into feat/shortcuts-improvements

* 'feat/shortcuts-improvements' of github.com:argilla-io/argilla:
  feat: update CLI to use async connection to DB (#3450)
  feat: add more value validations for rating questions (#3452)
  ci: selective `runs-on` value for tests execution (#3455)
  feat: update `package.yml` triggers (#3422)
  fix: uncancellable CI jobs (#3458)
  chore: Fix `ruff` line length (#3459)
  [pre-commit.ci] pre-commit autoupdate (#3449)
  improvement: Better efficiency of Weak Labels when vectors exist (#3444)
  refactor: add `ArgillaDatasetMixin` and re-structure `argilla.feedback.schemas` (#3427)
  chore: Set release version
  fix: add missing `suggestion_type_enum` values (#3445)
  [pre-commit.ci] pre-commit autoupdate (#3380)
  docs: fix username in HF Spaces docs (#3432)
@alvarobartt alvarobartt self-assigned this Aug 10, 2023
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.

2 participants