Skip to content

Commit c7073d7

Browse files
committed
Merge branch 'main' into develop
2 parents a46c3b3 + ebffa1b commit c7073d7

File tree

17 files changed

+334
-42
lines changed

17 files changed

+334
-42
lines changed

.github/workflows/argilla-server.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
defaults:
8+
run:
9+
shell: bash -l {0}
10+
working-directory: argilla-server
11+
712
on:
813
workflow_dispatch:
914
push:
@@ -31,11 +36,6 @@ jobs:
3136
name: Build `argilla-server` package
3237
runs-on: ubuntu-latest
3338

34-
defaults:
35-
run:
36-
shell: bash -l {0}
37-
working-directory: argilla-server
38-
3939
services:
4040
elasticsearch:
4141
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.2
@@ -164,11 +164,6 @@ jobs:
164164
# IMPORTANT: this permission is mandatory for trusted publishing on PyPI
165165
id-token: write
166166

167-
defaults:
168-
run:
169-
shell: bash -l {0}
170-
working-directory: ./argilla-server
171-
172167
steps:
173168
- name: Checkout Code 🛎
174169
uses: actions/checkout@v4
@@ -182,13 +177,18 @@ jobs:
182177
- name: Setup PDM
183178
uses: pdm-project/setup-pdm@v4
184179
with:
180+
python-version-file: argilla-server/pyproject.toml
181+
cache-dependency-path: argilla-server/pdm.lock
185182
cache: true
186183

187184
- name: Publish Package to PyPI test environment 🥪
188-
run: pdm publish --no-build --repository testpypi
185+
run: |
186+
pdm publish --no-build --repository testpypi
189187
190188
- name: Test Installing 🍿
191-
run: pip install --index-url https://test.pypi.org/simple --no-deps argilla-server==${GITHUB_REF#refs/*/v}
189+
run: |
190+
pip install --index-url https://test.pypi.org/simple --no-deps argilla-server==${GITHUB_REF#refs/*/v}
192191
193192
- name: Publish Package to PyPI 🥩
194-
run: pdm publish --no-build
193+
run: |
194+
pdm publish --no-build

.github/workflows/argilla.build-python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
rm -rf dist && python -m build
3131
3232
- name: Upload package artifact
33-
uses: actions/upload-artifact@v3
33+
uses: actions/upload-artifact@v4
3434
with:
35-
name: python-package
35+
name: argilla
3636
path: argilla/dist

.github/workflows/argilla.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
workflow_dispatch:
99
workflow_call:
1010

11+
push:
12+
tags:
13+
- "*"
14+
branches:
15+
- main
16+
- develop
17+
- releases/**
18+
1119
pull_request:
1220
paths:
1321
- "argilla/**"
@@ -111,14 +119,15 @@ jobs:
111119
defaults:
112120
run:
113121
shell: bash -l {0}
122+
working-directory: argilla
114123
steps:
115124
- name: Checkout Code 🛎
116125
uses: actions/checkout@v4
117126

118127
- name: Download python package
119128
uses: actions/download-artifact@v4
120129
with:
121-
name: python-package
130+
name: argilla
122131
path: dist
123132

124133
- name: Publish Package to TestPyPI 🥪

argilla-frontend/components/feedback-task/container/fields/RecordMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export default {
9999
:deep(.dropdown__content) {
100100
min-width: 100%;
101101
left: auto;
102-
right: 0;
103-
top: calc(100% + $base-space * 2);
102+
right: 100%;
103+
top: 0;
104104
}
105105
}
106106
</style>

argilla-frontend/components/feedback-task/container/fields/RecordMetadataInfo.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ export default {
9292
<style lang="scss" scoped>
9393
.table-info {
9494
background: palette(white);
95-
min-width: 460px;
95+
min-width: 440px;
9696
border-radius: $border-radius-s;
9797
overflow: hidden;
9898
@include font-size(13px);
9999
box-shadow: $shadow;
100100
&__content {
101-
max-height: 320px;
101+
max-height: 280px;
102102
overflow: auto;
103103
}
104104
&__header {
@@ -112,6 +112,7 @@ export default {
112112
.--table & {
113113
background: $black-6;
114114
border-top: 1px solid $black-10;
115+
border-bottom: 1px solid $black-10;
115116
}
116117
}
117118
&__row {
@@ -120,7 +121,7 @@ export default {
120121
gap: $base-space * 2;
121122
padding: $base-space $base-space * 2;
122123
.--table & {
123-
border-top: 1px solid $black-10;
124+
border-bottom: 1px solid $black-10;
124125
&:nth-child(even) {
125126
background: $black-4;
126127
}
@@ -135,6 +136,9 @@ export default {
135136
flex-basis: 44%;
136137
margin: 0;
137138
@include truncate;
139+
.--intro & {
140+
flex-basis: 100px;
141+
}
138142
}
139143
&__value {
140144
display: flex;
@@ -145,6 +149,9 @@ export default {
145149
margin: 0;
146150
font-family: $quaternary-font-family;
147151
word-break: break-all;
152+
.--intro & {
153+
flex-basis: 100%;
154+
}
148155
}
149156
&__copy {
150157
opacity: 0;

argilla-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "argilla",
3-
"version": "1.29.0-dev",
3+
"version": "1.29.0",
44
"private": true,
55
"scripts": {
66
"dev": "nuxt",

argilla-server/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ These are the section headers that we use:
1616

1717
## [Unreleased]()
1818

19+
## [1.29.0](https://github.com/argilla-io/argilla/compare/v1.28.0...v1.29.0)
20+
1921
### Added
2022

2123
- Added support for rating questions to include `0` as a valid value. ([#4858](https://github.com/argilla-io/argilla/pull/4858))
@@ -32,6 +34,10 @@ These are the section headers that we use:
3234
- Added `GET /api/v1/version` endpoint to get the current Argilla version. ([#162](https://github.com/argilla-io/argilla-server/pull/162))
3335
- Added `GET /api/v1/status` endpoint to get Argilla service status. ([#165](https://github.com/argilla-io/argilla-server/pull/165))
3436

37+
## Fixed
38+
39+
- Fixed error when fetching record with metadata values with visibility restrictions. ([#4906](https://github.com/argilla-io/argilla/pull/4906))
40+
3541
## [1.28.0](https://github.com/argilla-io/argilla-server/compare/v1.27.0...v1.28.0)
3642

3743
### Added

argilla-server/docker/server/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN python -m venv /opt/venv
66
ENV PATH="/opt/venv/bin:$PATH"
77
RUN apt-get update && \
88
apt-get install -y python-dev-is-python3 libpq-dev gcc && \
9+
pip install --upgrade pip && \
910
pip install uvicorn[standard] && \
1011
for wheel in /packages/*.whl; do pip install "$wheel"[server,postgresql]; done && \
1112
apt-get remove -y python-dev-is-python3 libpq-dev gcc && \

argilla-server/src/argilla_server/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414

1515
# coding: utf-8
16-
__version__ = "1.29.0-dev"
16+
__version__ = "1.29.0"

argilla-server/src/argilla_server/apis/v1/handlers/datasets/records.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import re
16-
from typing import Dict, List, Optional, Tuple, Union
16+
from typing import Any, Dict, List, Optional, Tuple, Union
1717
from uuid import UUID
1818

1919
from fastapi import APIRouter, Depends, HTTPException, Query, Security, status
@@ -29,7 +29,7 @@
2929
from argilla_server.errors.future.base_errors import MISSING_VECTOR_ERROR_CODE
3030
from argilla_server.models import Dataset as DatasetModel
3131
from argilla_server.models import Record, User
32-
from argilla_server.policies import DatasetPolicyV1, authorize
32+
from argilla_server.policies import DatasetPolicyV1, RecordPolicyV1, authorize, is_authorized
3333
from argilla_server.schemas.v1.datasets import Dataset
3434
from argilla_server.schemas.v1.records import (
3535
Filters,
@@ -83,7 +83,6 @@
8383
_VALID_SORT_VALUES = tuple(sort.value for sort in SortOrder)
8484
_METADATA_PROPERTY_SORT_BY_REGEX = re.compile(r"^metadata\.(?P<name>(?=.*[a-z0-9])[a-z0-9_-]+)$")
8585

86-
8786
SortByQueryParamParsed = Annotated[
8887
Dict[str, str],
8988
Depends(
@@ -410,7 +409,7 @@ async def list_current_user_dataset_records(
410409
limit: int = Query(default=LIST_DATASET_RECORDS_LIMIT_DEFAULT, ge=1, le=LIST_DATASET_RECORDS_LIMIT_LE),
411410
current_user: User = Security(auth.get_current_user),
412411
):
413-
dataset = await _get_dataset_or_raise(db, dataset_id)
412+
dataset = await _get_dataset_or_raise(db, dataset_id, with_metadata_properties=True)
414413

415414
await authorize(current_user, DatasetPolicyV1.get(dataset))
416415

@@ -427,6 +426,10 @@ async def list_current_user_dataset_records(
427426
sort_by_query_param=sort_by_query_param,
428427
)
429428

429+
for record in records:
430+
record.dataset = dataset
431+
record.metadata_ = await _filter_record_metadata_for_user(record, current_user)
432+
430433
return Records(items=records, total=total)
431434

432435

@@ -570,8 +573,7 @@ async def search_current_user_dataset_records(
570573
limit: int = Query(default=LIST_DATASET_RECORDS_LIMIT_DEFAULT, ge=1, le=LIST_DATASET_RECORDS_LIMIT_LE),
571574
current_user: User = Security(auth.get_current_user),
572575
):
573-
dataset = await _get_dataset_or_raise(db, dataset_id, with_fields=True)
574-
576+
dataset = await _get_dataset_or_raise(db, dataset_id, with_fields=True, with_metadata_properties=True)
575577
await authorize(current_user, DatasetPolicyV1.search_records(dataset))
576578

577579
await _validate_search_records_query(db, body, dataset_id)
@@ -589,7 +591,7 @@ async def search_current_user_dataset_records(
589591
sort_by_query_param=sort_by_query_param,
590592
)
591593

592-
record_id_score_map = {
594+
record_id_score_map: Dict[UUID, Dict[str, Union[float, SearchRecord, None]]] = {
593595
response.record_id: {"query_score": response.score, "search_record": None}
594596
for response in search_responses.items
595597
}
@@ -603,6 +605,9 @@ async def search_current_user_dataset_records(
603605
)
604606

605607
for record in records:
608+
record.dataset = dataset
609+
record.metadata_ = await _filter_record_metadata_for_user(record, current_user)
610+
606611
record_id_score_map[record.id]["search_record"] = SearchRecord(
607612
record=RecordSchema.from_orm(record), query_score=record_id_score_map[record.id]["query_score"]
608613
)
@@ -698,3 +703,14 @@ async def list_dataset_records_search_suggestions_options(
698703
for sa in suggestion_agents_by_question
699704
]
700705
)
706+
707+
708+
async def _filter_record_metadata_for_user(record: Record, user: User) -> Optional[Dict[str, Any]]:
709+
if record.metadata_ is None:
710+
return None
711+
712+
metadata = {}
713+
for metadata_name in list(record.metadata_.keys()):
714+
if await is_authorized(user, RecordPolicyV1.get_metadata(record, metadata_name)):
715+
metadata[metadata_name] = record.metadata_[metadata_name]
716+
return metadata

0 commit comments

Comments
 (0)