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

[DRAFT] [REFACTOR] Iterate settings management from the SDK #5564

Draft
wants to merge 3 commits into
base: experiment/add-record-to-draft-dataset
Choose a base branch
from

Conversation

frascuchon
Copy link
Member

@frascuchon frascuchon commented Oct 3, 2024

Description

This PR reviews and fixes some errors when working with settings for draft datasets.

import argilla as rg

local = rg.Argilla(api_key="argilla.apikey")

if dataset := local.datasets("draft_dataset"):
    dataset.delete()
    
dataset = rg.Dataset(name="draft_dataset")

# This is a workaround and could be changed
dataset.create(publish=False)

dataset.settings.fields.add(rg.TextField(name="text"))
dataset.update()

dataset.records.log([{"text": "Hello, World!"}])

dataset.settings.fields.add(rg.TextField(name="label"))
dataset.update()

# This doesn't work yet 
dataset.settings.fields["label"].required = False
dataset.update()

dataset.records.log([{"text": "Hello, World!", "label": "greeting"}])

dataset.settings.fields.remove("text")

dataset.settings.questions.add(rg.TextQuestion(name="comment"))
dataset.update()

dataset.records.log([{"comment": "This is a comment", "label": "greeting"}])

Type of change

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

How Has This Been Tested

Checklist

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

- fix: settings.schema is not cached anymore
- feat: Allow to update and delete questions
- fix: properly remove settings with <settings_collection>.remove()
@frascuchon frascuchon requested a review from burtenshaw October 3, 2024 12:48
@frascuchon frascuchon changed the title [REFACTOR] Iterate settings management from the SDK [DRAFT] [REFACTOR] Iterate settings management from the SDK Oct 11, 2024
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.

1 participant