diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f69cafe88..8aa214a8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,13 +3,13 @@ default_language_version: python: python3 repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.17.1 + rev: v0.17.3 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.4.0 + rev: v2.4.1 hooks: - id: mypy additional_dependencies: diff --git a/tests/test_datasets/test_dataset_functions.py b/tests/test_datasets/test_dataset_functions.py index fae4a1c4e..43e1c23c2 100644 --- a/tests/test_datasets/test_dataset_functions.py +++ b/tests/test_datasets/test_dataset_functions.py @@ -564,6 +564,7 @@ def test__retrieve_class_labels(self): labels = custom_ds.retrieve_class_labels(target_name=custom_ds.features[31].name) assert labels == ["COIL", "SHEET"] + @pytest.mark.skip(reason="URL upload disabled since PHP API v1.3.2") @pytest.mark.test_server def test_upload_dataset_with_url(self): dataset = OpenMLDataset( @@ -594,19 +595,25 @@ def _assert_status_of_dataset(self, *, did: int, status: str): not os.environ.get(openml.config.OPENML_TEST_SERVER_ADMIN_KEY_ENV_VAR), reason="Test requires admin key. Set OPENML_TEST_SERVER_ADMIN_KEY environment variable.", ) - @pytest.mark.flaky @pytest.mark.test_server def test_data_status(self): + arff_file_path = ( + self.static_cache_dir / "org" / "openml" / "test" / "datasets" / "2" / "dataset.arff" + ) dataset = OpenMLDataset( - f"{self._get_sentinel()}-UploadTestWithURL", + "anneal", "test", - "ARFF", + data_format="arff", version=1, - url="https://www.openml.org/data/download/61/dataset_61_iris.arff", + licence="public", + default_target_attribute="class", + data_file=arff_file_path, ) dataset.publish() - TestBase._mark_entity_for_removal("data", dataset.id) - TestBase.logger.info(f"collected from {__file__.split('/')[-1]}: {dataset.id}") + TestBase._mark_entity_for_removal("data", dataset.dataset_id) + TestBase.logger.info( + f"collected from {__file__.split('/')[-1]}: {dataset.dataset_id}", + ) did = dataset.id # admin key for test server (only admins can activate datasets.