diff --git a/argilla/CHANGELOG.md b/argilla/CHANGELOG.md index e67afc0c9b..0e16250f64 100644 --- a/argilla/CHANGELOG.md +++ b/argilla/CHANGELOG.md @@ -15,6 +15,8 @@ These are the section headers that we use: --> ## [Unreleased]() +### Changed +- Changed the __repr__ method for `SettingsProperties` to display the details of all the properties in `Setting` object. ([#5380](https://github.com/argilla-io/argilla/issues/5380)) ## [2.2.0](https://github.com/argilla-io/argilla/compare/v2.1.0...v2.2.0) @@ -25,6 +27,7 @@ These are the section headers that we use: - Added multiple error handling methods to the `rg.Dataset.records.log` method to warn, ignore, or raise errors. ([#5466](https://github.com/argilla-io/argilla/pull/5463)) - Changed dataset import and export of `rg.LabelQuestion` to use `datasets.ClassLabel` not `datasets.Value`. ([#5474](https://github.com/argilla-io/argilla/pull/5474)) + ## [2.1.0](https://github.com/argilla-io/argilla/compare/v2.0.1...v2.1.0) ### Added diff --git a/argilla/src/argilla/settings/_resource.py b/argilla/src/argilla/settings/_resource.py index ff5b707a83..1156a69484 100644 --- a/argilla/src/argilla/settings/_resource.py +++ b/argilla/src/argilla/settings/_resource.py @@ -488,6 +488,10 @@ def _validate_new_property(self, property: Property) -> None: if property.name in dir(self): raise ValueError(f"Property with name {property.name!r} conflicts with an existing attribute") + def __repr__(self) -> str: + """Return a string representation of the object.""" + return f"{repr([prop for prop in self])}" + class QuestionsProperties(SettingsProperties[QuestionType]): """ diff --git a/argilla/tests/unit/test_settings/test_settings.py b/argilla/tests/unit/test_settings/test_settings.py index ad7939142d..0dbf7965e8 100644 --- a/argilla/tests/unit/test_settings/test_settings.py +++ b/argilla/tests/unit/test_settings/test_settings.py @@ -73,12 +73,22 @@ def test_settings_repr(self): settings = rg.Settings( fields=[ rg.TextField(name="text", title="text"), + rg.ImageField(name="image", title="image"), ], metadata=[ rg.FloatMetadataProperty("source"), ], questions=[ rg.LabelQuestion(name="label", title="text", labels=["positive", "negative"]), + rg.RatingQuestion(name="rating", title="text", values=[1, 2, 3, 4, 5]), + rg.TextQuestion(name="text", title="text"), + rg.SpanQuestion( + name="span", + title="text", + field="text", + labels=["Apparatus", "Method", "Machine", "Manufacture", "Design"], + visible_labels=3, + ), ], vectors=[rg.VectorField(name="text", dimensions=3)], )