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 record timestamps to export #5754

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions argilla-server/src/argilla_server/contexts/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ def _row_attributes(self, record: Record) -> dict:
return {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
}

Expand Down
1 change: 0 additions & 1 deletion argilla-server/tests/unit/contexts/hub/test_hub_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from sqlalchemy.ext.asyncio import AsyncSession

from argilla_server.api.schemas.v1.datasets import HubDatasetMapping, HubDatasetMappingItem
from argilla_server.api.schemas.v1.metadata_properties import IntegerMetadataProperty
from argilla_server.enums import DatasetStatus, QuestionType
from argilla_server.models import Record
from argilla_server.contexts.hub import HubDataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def test_export_to(self, sync_test_session, hf_api: HfApi, hf_dataset_name: str)
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
}
Expand Down Expand Up @@ -279,6 +281,8 @@ def test_export_to_with_text_question(self, sync_test_session, hf_dataset_name:
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"text-question.responses": ["This is a response", "This is another response"],
Expand Down Expand Up @@ -340,6 +344,8 @@ def test_export_to_with_text_question_and_suggestion(self, sync_test_session, hf
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"text-question.responses": ["This is a response", "This is another response"],
Expand Down Expand Up @@ -402,6 +408,8 @@ def test_export_to_with_rating_question(self, sync_test_session, hf_dataset_name
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"rating-question.responses": [2, 0],
Expand Down Expand Up @@ -468,6 +476,8 @@ def test_export_to_with_rating_question_and_suggestion(self, sync_test_session,
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"rating-question.responses": [2, 0],
Expand Down Expand Up @@ -529,6 +539,8 @@ def test_export_to_with_label_question(self, sync_test_session, hf_dataset_name:
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"label-question.responses": ["label-b", "label-a"],
Expand Down Expand Up @@ -594,6 +606,8 @@ def test_export_to_with_label_question_and_suggestion(self, sync_test_session, h
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"label-question.responses": ["label-b", "label-a"],
Expand Down Expand Up @@ -655,6 +669,8 @@ def test_export_to_with_multi_label_question(self, sync_test_session, hf_dataset
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"multi-label-question.responses": [["label-a", "label-b"], ["label-c", "label-a"]],
Expand Down Expand Up @@ -720,6 +736,8 @@ def test_export_to_with_multi_label_question_and_suggestion(self, sync_test_sess
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"multi-label-question.responses": [["label-a", "label-b"], ["label-c", "label-a"]],
Expand Down Expand Up @@ -790,6 +808,8 @@ def test_export_to_with_ranking_question(self, sync_test_session, hf_dataset_nam
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"ranking-question.responses": [
Expand Down Expand Up @@ -880,6 +900,8 @@ def test_export_to_with_ranking_question_and_suggestion(self, sync_test_session,
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"ranking-question.responses": [
Expand Down Expand Up @@ -964,6 +986,8 @@ def test_export_to_with_span_question(self, sync_test_session, hf_dataset_name:
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"span-question.responses": [
Expand Down Expand Up @@ -1047,6 +1071,8 @@ def test_export_to_with_span_question_and_suggestion(self, sync_test_session, hf
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"span-question.responses": [
Expand Down Expand Up @@ -1102,6 +1128,8 @@ def test_export_to_with_draft_response(self, sync_test_session, hf_dataset_name:
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"text-question.responses": [None],
Expand Down Expand Up @@ -1143,6 +1171,8 @@ def test_export_to_with_discarded_response(self, sync_test_session, hf_dataset_n
assert exported_dataset[0] == {
"id": record.external_id,
"status": record.status,
"inserted_at": record.inserted_at,
"updated_at": record.updated_at,
"_server_id": str(record.id),
"text": "Hello World",
"text-question.responses": [None],
Expand Down
Loading