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

[RELEASES] 2.0.0rc2 #5160

Merged
merged 35 commits into from
Jul 5, 2024
Merged

[RELEASES] 2.0.0rc2 #5160

merged 35 commits into from
Jul 5, 2024

Conversation

frascuchon
Copy link
Member

No description provided.

frascuchon and others added 30 commits June 21, 2024 10:55
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

- Always run on `main`, `develop`, and `releases/**` branches
- Pull request runs will be filtered by affected files
- Docker images will be built on `main`, `develop`, and `releases/**` or
whatever PR affecting server changes.


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the 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 add some reference about how your feature has been tested.
-->
Running some actions

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
Restore method deleted when removed prevous datasets
…5088)

Co-authored-by: nataliaElv <natalia@argilla.io>
Co-authored-by: davidberenstein1957 <david.m.berenstein@gmail.com>
This PR reviews the specific tag version deployment and deploys (and
pushes) versions when a tag in the format vX.Y.Z is pushed.

- The `--push` option was missing in the previous version
- The version deployed will keep only the minor version. That means tags
for a patch version `v2.1.3` will deploy the docs `v2.1`

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

---------

Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
This PR passes the extra headers pass to `Argilla` down to the http
client so that argilla sdk can be used with authenticate deployment like
provate HF spaces.

- Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

Co-authored-by: Ben Burtenshaw <benjamin.burtenshaw@huggingface.co>
This change adapt the base settings model so that name is not used as a
default description for questions.

- Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

Co-authored-by: Ben Burtenshaw <benjamin.burtenshaw@huggingface.co>
- [x] Add doc reference file into frontend project
- [x] Refactor user entity
- [x] Change documentation dinamically depends if runninng locally or
running in HF env.
- [x] Fix copy button because was changing the padding

---------

Co-authored-by: burtenshaw <ben@argilla.io>
…5126)

# Description

This PR adds the following changes:
* Change `Responses` SqlAlchemy ORM model to delete responses on cascade
when a user is deleted.
* Add a migration for `responses` doing the following:
* Removing all the responses rows with `user_id` equal to `NULL` so the
foreign key constraint can be modified.
* Change `user_id` constraint to delete on cascade responses when a user
is deleted.
  * Change `user_id` to be non nullable.


Closes #5109 

**Type of change**

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

**How Has This Been Tested**

- [x] Manually tested on PostgreSQL and SQLite.
- [x] It should be tested on an environment with responses with
`user_id` equal to `NULL`.

**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
- [ ] I confirm 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/)

---------

Co-authored-by: Paco Aranda <francis@argilla.io>
Reviewing and improving records.log

Instead of: 

<img width="1335" alt="Captura de pantalla 2024-06-26 a las 12 48 14"
src="https://github.com/argilla-io/argilla/assets/2518789/02283f4c-fe6a-464f-96b3-36853e6c7622">

for 50 records, records.log can log 1000:

<img width="870" alt="Captura de pantalla 2024-06-26 a las 12 48 57"
src="https://github.com/argilla-io/argilla/assets/2518789/d20f0469-0b33-427e-aa12-b4b7e1d40cd1">
![Screenshot 2024-06-28 at 13 06
52](https://github.com/argilla-io/argilla/assets/7398909/197a18d9-a2e7-43dc-93ff-9e66fbbbf778)

---------

Co-authored-by: nataliaElv <natalia@argilla.io>
this PR adds min-height to fix the container height
This PR fixes the copy button behavior in the dataset list
…st (#5137)

This PR changes the structure generated by `to_list(flatten=True)` to
simplify reading responses. The response content is split into values
and users, so no user ID is defined as part of the column name:

The result for the following record:

```python

record = rg.Record(
    fields={"field": "The field"},
    metadata={"key": "value"},
    responses=[
        rg.Response(question_name="q1", value="value", user_id=user_a),
        rg.Response(question_name="q2", value="value", user_id=user_a),
        rg.Response(question_name="q2", value="value", user_id=user_b),
        rg.Response(question_name="q1", value="value", user_id=user_c),
    ],
    suggestions=[
        rg.Suggestion(question_name="q1", value="value", score=0.1, agent="test"),
        rg.Suggestion(question_name="q2", value="value", score=0.9),
    ],
)
```
is :
```python
{
    "id": <record_id>,
    "_server_id": None,
    "field": "The field",
    "key": "value",
    "q1.responses": ["value", "value"],
    "q1.responses.users": [str(user_a), str(user_c)],
    "q2.responses": ["value", "value"],
    "q2.responses.users": [str(user_a), str(user_b)],
    "q1.suggestion": "value",
    "q1.suggestion.score": 0.1,
    "q1.suggestion.agent": "test",
    "q2.suggestion": "value",
    "q2.suggestion.score": 0.9,
    "q2.suggestion.agent": None,
}
```

Refs #4936

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

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

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

---------

Co-authored-by: burtenshaw <ben@argilla.io>
)

# Pull Request Template
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR defines `argilla-v1` as an optional dependency. 

Closes #5096

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- 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)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
# Pull Request Template
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

> [!NOTE]  
> This PR should be merged after merge
#5137


This PR addresses problems when exporting records to dicts including
records partially filled. This PR fixes the errors commented in
#4936 (comment)

Close #4936

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

---------

Co-authored-by: burtenshaw <ben@argilla.io>
Co-authored-by: Ben Burtenshaw <benjamin.burtenshaw@huggingface.co>
…#5124)

<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR supports reading responses from the server in a `draft` status
with no values in any of the questions (A clear form). This will be read
as no responses in the new SDK (@burtenshaw we should validate this).

Closes #5049

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Refactor (change restructuring the codebase without changing
functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
…on is correctly executed (#5149)

# Description

After changing SQLite connection to be asynchronous on version `1.14.0`
using `aiosqlite`. There was a type check that was not changed and
causing the connection configuration to not be executed for SQLite.

This PR fix the type check so the configuration statements are correctly
executed and add a test to check for the expected values.

**Type of change**

- Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

- [x] Manually testing it with SQLite.

**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
- I confirm 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/)
# Description

This PR update some dependencies related with SQLAlchemy.

**Type of change**

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

**How Has This Been Tested**

- Running test suite with SQLite and PostgreSQL.

**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
- I confirm 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/)
…ces (#5152)

<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR removes the workspace resolution on `Dataset.__init__` and
performs it lazily when creating datasets or accessing the
`dataset.workspace` property

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- 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)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
…ring using the SDK (#5145)

<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR renames the `status` key to `response.status` for filtering with
the SDK.


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Refactor (change restructuring the codebase without changing
functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
…5107)

This PR refactors refactors the ingestion flow in `DatasetRecords` by
implementing a new class and module `IngestedRecordMapper`

This PR supports mapping incoming columns/keys to dataset attributes in
these two ways:

- supports tuple values in the mapping parameter of the log method so
that user can specify the two attributes as a tuple.
- refactors in the `_ingest_records` methods so that mapping is
performed once before the ingestion loop instead of during.

This PR also optimises the `log` method so that it takes less time and
is easier to work with:
- uses tqdm to log status 
- uses exception to show bad records
- iterates over the map not the data

<img width="689" alt="Screenshot 2024-06-26 at 09 09 11"
src="https://github.com/argilla-io/argilla/assets/19620375/fbdf2840-1d17-4764-bd4c-2665e95afc14">


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

**How Has This Been Tested**
- tests have been modified, deprecated, and updated to support changes
in the ingestion flow

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Paco Aranda <francis@argilla.io>
…g response values without user (#5159)

# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR fixes missing `await` call included in
#5003


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.96%. Comparing base (d9b215d) to head (1e6cb47).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5160      +/-   ##
==========================================
+ Coverage   91.93%   91.96%   +0.02%     
==========================================
  Files         135      135              
  Lines        5818     5821       +3     
==========================================
+ Hits         5349     5353       +4     
+ Misses        469      468       -1     
Flag Coverage Δ
argilla-server 91.96% <100.00%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 4, 2024

The URL of the deployed environment for this PR is https://argilla-quickstart-pr-5160-ki24f765kq-no.a.run.app

# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

Apparently naming python optional dependencies with `v1` is not allowed
and the installation process fails
```bash
...
    self._link_candidate_cache[link] = LinkCandidate(
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
    super().__init__(
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
    self.dist = self._prepare()
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 247, in _prepare
    self._check_metadata_consistency(dist)
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 229, in _check_metadata_consistency
    list(dist.iter_dependencies(list(dist.iter_provided_extras())))
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/metadata/pkg_resources.py", line 250, in iter_provided_extras
    return self._extra_mapping.keys()
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_internal/metadata/pkg_resources.py", line 94, in _extra_mapping
    canonicalize_name(extra): extra for extra in self._dist.extras
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3026, in extras
    return [dep for dep in self._dep_map if dep]
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3072, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3089, in _compute_dependencies
    common = types.MappingProxyType(dict.fromkeys(reqs_for_extra(None)))
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3086, in reqs_for_extra
    if not req.marker or req.marker.evaluate({'extra': extra}):
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 325, in evaluate
    return _evaluate_markers(self._markers, current_environment)
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 225, in _evaluate_markers
    groups[-1].append(_eval_op(lhs_value, op, rhs_value))
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 183, in _eval_op
    return spec.contains(lhs, prereleases=True)
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/specifiers.py", line 552, in contains
    normalized_item = _coerce_version(item)
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/specifiers.py", line 28, in _coerce_version
    version = Version(version)
  File "/Users/frascuchon/.pyenv/versions/3.9.18/envs/2.0.0/lib/python3.9/site-packages/pip/_vendor/packaging/version.py", line 202, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pip._vendor.packaging.version.InvalidVersion: Invalid version: ''
```

We need to change the `v1` to another valid name: `sdk-v1`

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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
- I confirm 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/)
Reverts changes from #5164 and rename dependencies to
`legacy`
@frascuchon frascuchon merged commit 1e6cb47 into main Jul 5, 2024
26 checks passed
@frascuchon frascuchon deleted the releases/2.0.0rc2 branch July 5, 2024 08:28
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.

5 participants