Skip to content

Commit af1e488

Browse files
authored
chore: Remove old code related to legacy datasets (#5274)
# Description <!-- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. --> This PR removes old code related to the legacy datasets **Type of change** <!-- Please delete options that are not relevant. Remember to title the PR according to the type of change --> **How Has This Been Tested** <!-- Please add some reference about how your feature has been tested. --> **Checklist** <!-- Please go over the list and make sure you've taken everything into account --> - 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/)
1 parent 58ef6bc commit af1e488

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

argilla-server/src/argilla_server/settings.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ class Settings(BaseSettings):
102102

103103
docs_enabled: bool = True
104104

105-
namespace: str = Field(default=None, regex=r"^[a-z]+$")
106-
107105
enable_migration: bool = Field(
108106
default=False,
109107
description="If enabled, try to migrate data from old rubrix installation",
@@ -210,36 +208,6 @@ def create_home_path(cls, values):
210208

211209
return values
212210

213-
@property
214-
def dataset_index_name(self) -> str:
215-
ns = self.namespace
216-
if ns:
217-
return f"{self.namespace}.{self.__DATASETS_INDEX_NAME__}"
218-
return self.__DATASETS_INDEX_NAME__
219-
220-
@property
221-
def dataset_records_index_name(self) -> str:
222-
ns = self.namespace
223-
if ns:
224-
return f"{self.namespace}.{self.__DATASETS_RECORDS_INDEX_NAME__}"
225-
return self.__DATASETS_RECORDS_INDEX_NAME__
226-
227-
@property
228-
def old_dataset_index_name(self) -> str:
229-
index_name = ".rubrix<NAMESPACE>.datasets-v0"
230-
ns = self.namespace
231-
if ns is None:
232-
return index_name.replace("<NAMESPACE>", "")
233-
return index_name.replace("<NAMESPACE>", f".{ns}")
234-
235-
@property
236-
def old_dataset_records_index_name(self) -> str:
237-
index_name = ".rubrix<NAMESPACE>.dataset.{}.records-v0"
238-
ns = self.namespace
239-
if ns is None:
240-
return index_name.replace("<NAMESPACE>", "")
241-
return index_name.replace("<NAMESPACE>", f".{ns}")
242-
243211
@property
244212
def database_engine_args(self) -> Dict:
245213
if self.database_is_sqlite:

argilla-server/tests/unit/commons/test_settings.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,8 @@
1313
# limitations under the License.
1414

1515
import pytest
16-
from argilla_server.settings import Settings
17-
18-
from tests.pydantic_v1 import ValidationError
19-
20-
21-
@pytest.mark.parametrize("bad_namespace", ["Badns", "bad-ns", "12-bad-ns", "@bad"])
22-
def test_wrong_settings_namespace(monkeypatch, bad_namespace):
23-
monkeypatch.setenv("ARGILLA_NAMESPACE", bad_namespace)
24-
with pytest.raises(ValidationError):
25-
Settings()
26-
2716

28-
def test_settings_namespace(monkeypatch):
29-
monkeypatch.setenv("ARGILLA_NAMESPACE", "namespace")
30-
31-
settings = Settings()
32-
33-
assert settings.namespace == "namespace"
34-
assert settings.dataset_index_name == "namespace.ar.datasets"
35-
assert settings.dataset_records_index_name == "namespace.ar.dataset.{}"
17+
from argilla_server.settings import Settings
3618

3719

3820
def test_settings_index_replicas_with_shards_defined(monkeypatch):

0 commit comments

Comments
 (0)