Skip to content

Commit

Permalink
Fix already exists issue while creating dataset with the name of the …
Browse files Browse the repository at this point in the history
…deleted dataset (VertaAI#1952)
  • Loading branch information
anandjakhaniya authored Feb 11, 2021
1 parent 0af248e commit b53b222
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import ai.verta.common.KeyValueQuery;
import ai.verta.common.ModelDBResourceEnum.ModelDBServiceResourceTypes;
import ai.verta.modeldb.*;
import ai.verta.modeldb.AddDatasetTags;
import ai.verta.modeldb.Dataset;
import ai.verta.modeldb.DatasetVisibilityEnum;
import ai.verta.modeldb.FindDatasets;
Expand All @@ -18,8 +18,12 @@
import ai.verta.modeldb.common.exceptions.ModelDBException;
import ai.verta.modeldb.dto.DatasetPaginationDTO;
import ai.verta.modeldb.entities.AttributeEntity;
import ai.verta.modeldb.entities.versioning.*;
import ai.verta.modeldb.entities.versioning.BranchEntity;
import ai.verta.modeldb.entities.versioning.CommitEntity;
import ai.verta.modeldb.entities.versioning.RepositoryEntity;
import ai.verta.modeldb.entities.versioning.RepositoryEnums;
import ai.verta.modeldb.entities.versioning.RepositoryEnums.RepositoryTypeEnum;
import ai.verta.modeldb.entities.versioning.TagsEntity;
import ai.verta.modeldb.experimentRun.ExperimentRunDAO;
import ai.verta.modeldb.metadata.IdentificationType;
import ai.verta.modeldb.metadata.MetadataDAO;
Expand Down Expand Up @@ -478,7 +482,9 @@ private RepositoryEntity setRepository(
CommonUtils.registeredBackgroundUtilsCount();
roleService.deleteEntityResourcesWithServiceUser(
deletedEntityIds.stream().map(String::valueOf).collect(Collectors.toList()),
ModelDBServiceResourceTypes.REPOSITORY);
repositoryType.equals(RepositoryTypeEnum.DATASET)
? ModelDBServiceResourceTypes.DATASET
: ModelDBServiceResourceTypes.REPOSITORY);
} finally {
CommonUtils.unregisteredBackgroundUtilsCount();
}
Expand Down

0 comments on commit b53b222

Please sign in to comment.