diff --git a/openml_OS/models/api/v1/Api_data.php b/openml_OS/models/api/v1/Api_data.php index 294d1300..c27bedab 100644 --- a/openml_OS/models/api/v1/Api_data.php +++ b/openml_OS/models/api/v1/Api_data.php @@ -1276,6 +1276,18 @@ private function data_upload() { /* * * * * THE ACTUAL INSERTION * * * */ + // 🔍 Check for duplicate dataset using file_id + // 🔍 Check for duplicate dataset using file_id + $existing = $this->Dataset->getWhereSingle('file_id = ' . $file_id); + if ($existing != false) { + $this->returnError( + 135, + $this->version, + $this->openmlGeneralErrorCode, + "Dataset with same file already exists" + ); + return; + } $id = $this->Dataset->insert($dataset); if (!$id) { $this->returnError(134, $this->version);