[FEATURE] Support updating setting attributes with persistent mapping
burtenshaw opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
I want to edits settings attributes, like fields or questions, when they have a mapping attribute, and be able to log records. At the moment, this will fail because the mapper tries to assign values to questions or fields that have been deleted.
Describe the solution you'd like
An ideal solution would update the Settings.mapping
within the setter methods so that delete attributes are removed from the mapping.
Describe alternatives you've considered
You can do this, but it either wipes the mapping, or is difficult to rebuild the mapping.
from random import randint
from datasets import load_dataset
ds = load_dataset("argilla/magpie-ultra-v0.1", split="train[:100]")
settings = rg.Settings.from_hub("argilla/magpie-ultra-v0.1")
settings.questions = [rg.TextQuestion(name="my_comment")]
settings.mapping = {}
dataset = rg.Dataset(name=f"magpie-ultra-{randint(0, 100000)}", settings=settings)
dataset.create()
dataset.records.log(ds)
Additional context
@frascuchon I will close this issue because we no longer rely on mapping in rg.Settings.from_hub