From 2f159eb5b82eeb320da5782cce367fa0c4e4dd13 Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Thu, 20 Jun 2024 16:16:27 +0200 Subject: [PATCH] [FEAT] improve notebook logging of log function (#5062) **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) - [x] Improvement (change adding some improvement to an existing functionality) - [ ] Documentation update **How Has This Been Tested** all integration tests pass **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](https://tally.so/r/n9XrxK) (see text above) - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: Ben Burtenshaw Co-authored-by: Paco Aranda --- argilla/pyproject.toml | 4 +++- argilla/src/argilla/records/_dataset_records.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/argilla/pyproject.toml b/argilla/pyproject.toml index a660510343..114ce0bdf3 100644 --- a/argilla/pyproject.toml +++ b/argilla/pyproject.toml @@ -13,7 +13,9 @@ dynamic = ["version"] dependencies = [ "httpx>=0.26.0", "pydantic>=2.6.0, <3.0.0", - "argilla-v1[listeners]" + "argilla-v1[listeners]", + "tqdm>=4.60.0", + "rich>=10.0.0", ] [project.optional-dependencies] diff --git a/argilla/src/argilla/records/_dataset_records.py b/argilla/src/argilla/records/_dataset_records.py index 5d2d0f4a0e..e6a641650d 100644 --- a/argilla/src/argilla/records/_dataset_records.py +++ b/argilla/src/argilla/records/_dataset_records.py @@ -211,7 +211,7 @@ def log( mapping: Optional[Dict[str, str]] = None, user_id: Optional[UUID] = None, batch_size: int = DEFAULT_BATCH_SIZE, - ) -> List[Record]: + ) -> "DatasetRecords": """Add or update records in a dataset on the server using the provided records. If the record includes a known `id` field, the record will be updated. If the record does not include a known `id` field, the record will be added as a new record. @@ -253,7 +253,7 @@ def log( level="info", ) - return created_or_updated + return self def delete( self,