Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
2546d4d
Add new files push feature python
mathieuroques Jun 22, 2023
82405ea
Added Suggest filter to ml_worker_service
mathieuroques Jun 22, 2023
f54633e
Reapply changes for push (back,front)
Googleton Jun 23, 2023
dc8ac8e
Push Popover fixes
Googleton Jun 23, 2023
a21528f
Fixed slicing function
mathieuroques Jun 26, 2023
bf5f3fb
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Jun 26, 2023
1e4778b
CTA part 1, fix overconf push not showing
Googleton Jun 26, 2023
d9df0da
CTA part 2, the "Save Slice" CTA now works!
Googleton Jun 27, 2023
3cebf2a
Automatic threshold for overconfidence and 0.1 for borderline
mathieuroques Jun 27, 2023
67ecefc
Merge branch 'main' into feature/merging-push-feature
andreybavt Jun 27, 2023
bed425d
Temp commit
Googleton Jun 28, 2023
e70edd6
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Jun 29, 2023
f24d036
Few more CTAs
Googleton Jun 30, 2023
8c94135
Change python side to use row data instead of row index (wip)
Googleton Jul 5, 2023
eb9053d
No more pushes?!
Googleton Jul 6, 2023
912d4cd
It half works now!
Googleton Jul 6, 2023
249cba5
changed 0 to df in ml_worker
mathieuroques Jul 6, 2023
6e34a4b
replaced all id by row in contribution
mathieuroques Jul 6, 2023
1cea7a0
replaced id by row in perturbation
mathieuroques Jul 6, 2023
97716d8
Updated prediction push by replacing idrow by df
mathieuroques Jul 6, 2023
fe14ffb
Fix bug in push call in ml worker
mathieuroques Jul 6, 2023
d2fe292
Debugger push works :)
Googleton Jul 7, 2023
1d1a1be
Merge branch 'main' into feature/merging-push-feature
andreybavt Jul 7, 2023
dfaf42e
j2ts
andreybavt Jul 7, 2023
57b5507
More push
Googleton Jul 11, 2023
c9a7c39
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Jul 11, 2023
6a59444
Fixed push generation when a column is empty
kevinmessiaen Jul 12, 2023
c0a655c
Now overconfidence push works
Googleton Jul 12, 2023
1a57e1a
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Jul 12, 2023
0429775
Fix a small bug where empty slices would create an error
Googleton Jul 21, 2023
91b5940
Fixed transformation issue
mathieuroques Jul 22, 2023
168aeb4
Merge branch 'main' into feature/merging-push-feature
Googleton Jul 24, 2023
0831a66
Fix some merge issues
Googleton Jul 24, 2023
dc861ad
Merge branch 'feature/merging-push-feature' into feature/gsk-1446
rabah-khalek Jul 24, 2023
e4264e2
Merge branch 'main' into feature/merging-push-feature
andreybavt Jul 24, 2023
ff15187
MAD transformation rework
mathieuroques Jul 24, 2023
248c599
Fixed push test errors and added 2 new ones for the numerical transfo…
mathieuroques Jul 24, 2023
86a0d0b
Merge branch 'feature/gsk-1446' of https://github.com/Giskard-AI/gisk…
mathieuroques Jul 24, 2023
d45bc00
Merge branch 'feature/merging-push-feature' into feature/gsk-1446
mathieuroques Jul 24, 2023
40e076c
fixed comments
mathieuroques Jul 24, 2023
34d656a
Merge pull request #1253 from Giskard-AI/feature/gsk-1446
mathieuroques Jul 24, 2023
864a416
GSK-1445 -- have to use df lower and upper bounds for this. Maybe the…
Googleton Jul 25, 2023
e960a73
Merge branch 'main' into feature/merging-push-feature
Googleton Jul 27, 2023
de6c1af
Review comments
Googleton Jul 28, 2023
c455d2b
Disable SaveExample for now
Googleton Jul 28, 2023
0887cea
Update contribution.py
mathieuroques Jul 28, 2023
717ec7d
Update __init__.py
mathieuroques Jul 28, 2023
da432d7
Create catalog.py
mathieuroques Jul 28, 2023
12465ef
update tests
mathieuroques Jul 31, 2023
940066c
Update __init__.py
mathieuroques Jul 31, 2023
5f8b195
3 -> 2 MAD
mathieuroques Jul 31, 2023
5085b44
Unactivate contribution right
mathieuroques Jul 31, 2023
1aefc5c
Handling of default values serialization for Giskard objects
kevinmessiaen Aug 1, 2023
428976d
Merge branch 'main' into feature/merging-push-feature
Googleton Aug 1, 2023
9ee1367
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
rabah-khalek Aug 3, 2023
be4e62b
changed create test CTA text
rabah-khalek Aug 4, 2023
4d1ed7a
Merge branch 'main' into feature/merging-push-feature
rabah-khalek Aug 4, 2023
0f05689
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
rabah-khalek Aug 4, 2023
589581e
Merge branch 'main' into feature/merging-push-feature
rabah-khalek Aug 4, 2023
d38075f
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
rabah-khalek Aug 4, 2023
4a556fd
Merge pull request #1296 from Giskard-AI/GSK-1491
mathieuroques Aug 7, 2023
c535a40
Feature/gsk 1405 make sure borderline threshold is consistent (#1257)
mathieuroques Aug 7, 2023
a791f3f
Update __init__.py
mathieuroques Aug 7, 2023
0c373bc
Revert "Update __init__.py"
mathieuroques Aug 7, 2023
55faeec
Update __init__.py
mathieuroques Aug 7, 2023
62c8a99
Split tests in tests and unit tests
mathieuroques Aug 7, 2023
2f9c8d6
Update __init__.py
mathieuroques Aug 7, 2023
baeb102
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
mathieuroques Aug 7, 2023
7c67f4a
Added new tests
mathieuroques Aug 7, 2023
6d176cb
Merge branch 'main' into feature/merging-push-feature
mathieuroques Aug 8, 2023
abee5b1
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
mathieuroques Aug 8, 2023
4781fe2
Merge branch 'main' into feature/merging-push-feature
rabah-khalek Aug 8, 2023
3d18f76
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
mathieuroques Aug 8, 2023
12b4ccd
Merge branch 'feature/merging-push-feature' into feature/gsk-1496-mak…
andreybavt Aug 8, 2023
43d6142
Cleaning tests
mathieuroques Aug 8, 2023
3ba4fb3
Merge branch 'feature/gsk-1496-make-sure-we-have-at-least-one-test-wo…
mathieuroques Aug 8, 2023
1057542
Rework overconfidence and underconfidence tests
mathieuroques Aug 8, 2023
9e4bfad
Update prediction.py
mathieuroques Aug 9, 2023
c914542
Reformat perturbation
mathieuroques Aug 9, 2023
b093de6
Update perturbation.py
mathieuroques Aug 9, 2023
66cdc8f
Reformat contribution
mathieuroques Aug 9, 2023
1f04d1d
format import
mathieuroques Aug 9, 2023
768f284
debug
mathieuroques Aug 10, 2023
6054588
Update perturbation.py
mathieuroques Aug 11, 2023
85aecad
Merge pull request #1273 from Giskard-AI/feature/gsk-1496-make-sure-w…
mathieuroques Aug 14, 2023
7d13c84
Set random seed in text_transformation
mathieuroques Aug 14, 2023
bd611ab
Add test_params attribute to push classes
mathieuroques Aug 14, 2023
b7dacc1
Add default args on the frontend
Googleton Aug 16, 2023
57cfe0a
Update __init__.py
mathieuroques Aug 16, 2023
5fa4ac4
Removed text features from contribution push and fixed one bug
mathieuroques Aug 16, 2023
65bfec8
Update perturbation push
mathieuroques Aug 17, 2023
e9a417b
Update perturbation push and some texts
mathieuroques Aug 18, 2023
8896c44
Fix some minor issues
Googleton Aug 22, 2023
8b647da
Fixed perturbation push issue
mathieuroques Aug 22, 2023
f8ded9e
Merge branch 'feature/merging-push-feature' of https://github.com/Gis…
mathieuroques Aug 22, 2023
68525ca
Fixed model type bug in contribution feature
mathieuroques Aug 22, 2023
6546dc6
Fix for overconfidence and borderline issue
mathieuroques Aug 22, 2023
674d420
Fix Direction issue in Contribution push test
mathieuroques Aug 22, 2023
8fd72d3
Update __init__.py
mathieuroques Aug 22, 2023
df4621d
Update __init__.py
mathieuroques Aug 23, 2023
fa4c0d2
Added docstrings
mathieuroques Aug 23, 2023
406940f
Update __init__.py
mathieuroques Aug 23, 2023
5973c11
Update __init__.py
mathieuroques Aug 23, 2023
f168161
Update __init__.py
mathieuroques Aug 23, 2023
8cea61b
Fix typing error on Python version < 3.10
henchaves Aug 23, 2023
d2c3689
Merge branch 'feature/merging-push-feature' into feature/gsk-1563-pus…
henchaves Aug 23, 2023
5d59a91
Update text_transformations.py
mathieuroques Aug 23, 2023
c4d1898
Fix isistance errors
henchaves Aug 23, 2023
aca75b0
Edit docstrings
mathieuroques Aug 23, 2023
104a88f
Control tooltip/card size and display full content
henchaves Aug 23, 2023
1ad2cc1
Wrap feature variables with grave accent
henchaves Aug 23, 2023
f64cbec
Merge branch 'feature/merging-push-feature' into feature/gsk-1563-pus…
henchaves Aug 23, 2023
438ec35
Minor polish
Googleton Aug 24, 2023
2c1047e
Merge branch 'feature/merging-push-feature' into feature/gsk-1563-pus…
henchaves Aug 24, 2023
09d34c8
Update __init__.py
mathieuroques Aug 24, 2023
ccf2532
push utils tests
mathieuroques Aug 24, 2023
65ffacb
Update test_push.py
mathieuroques Aug 24, 2023
5d0e600
Merge branch 'feature/merging-push-feature' into GSK-1590-docstrings
mathieuroques Aug 24, 2023
e8021b5
Merge pull request #1331 from Giskard-AI/GSK-1590-docstrings
mathieuroques Aug 24, 2023
50d09dd
Update perturbation.py
mathieuroques Aug 24, 2023
5985c93
Merge branch 'feature/merging-push-feature' into feature/gsk-1563-pus…
henchaves Aug 24, 2023
7799164
Merge branch 'main' into feature/merging-push-feature
Googleton Aug 25, 2023
dc0775a
Merge pull request #1328 from Giskard-AI/feature/gsk-1563-push-hover-…
henchaves Aug 25, 2023
bb4a035
added push to the doc
rabah-khalek Aug 28, 2023
e3e2f3c
added push to the doc
rabah-khalek Aug 28, 2023
fe7c0f5
Migrate to websockets
Googleton Aug 28, 2023
fc939c1
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Aug 28, 2023
3fb745f
moved push test catalog
rabah-khalek Aug 28, 2023
dfb2977
Merge branch 'feature/merging-push-feature' of https://github.com/Gis…
rabah-khalek Aug 28, 2023
f6230c8
cleanup and fix LOB issue
andreybavt Aug 28, 2023
8f5035f
fixed LOB for H2 and Postgres
andreybavt Aug 28, 2023
f6482e5
Merge branch 'main' into bug/fix-h2-db-lob
andreybavt Aug 28, 2023
ac79609
Merge branch 'main' into feature/merging-push-feature
andreybavt Aug 28, 2023
d702b99
Fixes on websocket migration
Googleton Aug 29, 2023
5bde05a
Merge remote-tracking branch 'origin/bug/fix-h2-db-lob' into feature/…
Googleton Aug 29, 2023
1d463f6
Merge branch 'main' into feature/merging-push-feature
andreybavt Aug 29, 2023
8567602
Fixed issues with upload
kevinmessiaen Aug 29, 2023
3dde349
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Aug 29, 2023
c45c9dc
Merge remote-tracking branch 'origin/fix/lambda_upload_issue' into fe…
Googleton Aug 29, 2023
e85a395
Merge branch 'main' into feature/merging-push-feature
rabah-khalek Aug 30, 2023
e5454f5
Merge branch 'main' into feature/merging-push-feature
rabah-khalek Aug 30, 2023
11d50d8
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Aug 30, 2023
48e3521
Cleanup
Googleton Aug 30, 2023
d890822
Cleanup
Googleton Aug 30, 2023
632f6c4
Merge branch 'main' into feature/merging-push-feature
andreybavt Aug 30, 2023
29a2ac2
attempt to fix the docs
rabah-khalek Aug 30, 2023
e31b7f4
Fix enum python side
Googleton Aug 30, 2023
d672251
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Aug 30, 2023
4d35bc7
relaunching docs
rabah-khalek Aug 30, 2023
c83a449
Merge branch 'main' into feature/merging-push-feature
andreybavt Aug 30, 2023
70b5093
regenerated j2ts
andreybavt Aug 30, 2023
45cc1cb
cleanup
andreybavt Aug 30, 2023
0a24a32
Cleanup
Googleton Aug 31, 2023
3de82bb
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Aug 31, 2023
d044ddd
More cleanup
Googleton Aug 31, 2023
3d6b7cb
Merge branch 'main' into feature/merging-push-feature
Googleton Aug 31, 2023
b286ce4
More little fixes
Googleton Sep 1, 2023
bf84900
Merge branch 'main' into feature/merging-push-feature
andreybavt Sep 1, 2023
95be4b5
More sonar codesmell fixes
Googleton Sep 1, 2023
2623030
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
Googleton Sep 1, 2023
14d9244
fix sonar complaints
andreybavt Sep 1, 2023
92656a0
fix sonar complaints
andreybavt Sep 1, 2023
d1760a8
Merge remote-tracking branch 'origin/feature/merging-push-feature' in…
andreybavt Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions backend/src/main/java/ai/giskard/domain/Callable.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package ai.giskard.domain;

import ai.giskard.utils.SimpleJSONStringAttributeConverter;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import jakarta.persistence.*;
import java.io.Serializable;
import java.util.List;
import java.util.UUID;
Expand All @@ -13,9 +13,6 @@
@Setter
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Entity(name = "callable_functions")
@Table(uniqueConstraints = {
@UniqueConstraint(columnNames = {"name", "module", "version"})
})
@DiscriminatorColumn(name = "callable_type", discriminatorType = DiscriminatorType.STRING)
public class Callable implements Serializable {
@Id
Expand Down
25 changes: 25 additions & 0 deletions backend/src/main/java/ai/giskard/domain/ml/CallToActionKind.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ai.giskard.domain.ml;

import com.dataiku.j2ts.annotations.UIModel;
import com.fasterxml.jackson.annotation.JsonValue;

@UIModel
public enum CallToActionKind {
NONE,
CREATE_SLICE,
CREATE_TEST,
CREATE_PERTURBATION,
SAVE_PERTURBATION,
CREATE_ROBUSTNESS_TEST,
CREATE_SLICE_OPEN_DEBUGGER,
OPEN_DEBUGGER_BORDERLINE,
ADD_TEST_TO_CATALOG,
SAVE_EXAMPLE,
OPEN_DEBUGGER_OVERCONFIDENCE,
CREATE_UNIT_TEST;

@JsonValue
public int toValue() {
return ordinal();
}
}
18 changes: 18 additions & 0 deletions backend/src/main/java/ai/giskard/domain/ml/PushKind.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ai.giskard.domain.ml;

import com.dataiku.j2ts.annotations.UIModel;
import com.fasterxml.jackson.annotation.JsonValue;

@UIModel
public enum PushKind {
INVALID,
PERTURBATION,
CONTRIBUTION,
OVERCONFIDENCE,
BORDERLINE;

@JsonValue
public int toValue() {
return ordinal();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import ai.giskard.web.dto.ml.TestResultMessageDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.persistence.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down
4 changes: 3 additions & 1 deletion backend/src/main/java/ai/giskard/ml/MLWorkerWSAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public enum MLWorkerWSAction {
GENERATE_TEST_SUITE("generateTestSuite"),
STOP_WORKER("stopWorker"),
GET_CATALOG("getCatalog"),
GENERATE_QUERY_BASED_SLICING_FUNCTION("generateQueryBasedSlicingFunction");
GENERATE_QUERY_BASED_SLICING_FUNCTION("generateQueryBasedSlicingFunction"),
GET_PUSH("getPush");

private final String actionName;

MLWorkerWSAction(String name) {
actionName = name;
}
Expand Down
35 changes: 35 additions & 0 deletions backend/src/main/java/ai/giskard/ml/dto/MLWorkerWSGetPushDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package ai.giskard.ml.dto;

import ai.giskard.domain.ml.CallToActionKind;
import ai.giskard.domain.ml.PushKind;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import javax.annotation.Nullable;
import java.util.Map;

@Getter
@Setter
@Builder
public class MLWorkerWSGetPushDTO implements MLWorkerWSBaseDTO {
private MLWorkerWSArtifactRefDTO dataset;
private MLWorkerWSArtifactRefDTO model;
private int rowIdx;
private MLWorkerWSDataFrameDTO dataframe;

private String target;

@JsonProperty("column_types")
private Map<String, String> columnTypes;

@JsonProperty("column_dtypes")
private Map<String, String> columnDtypes;
@Nullable
@JsonProperty("push_kind")
private PushKind pushKind;
@Nullable
@JsonProperty("cta_kind")
private CallToActionKind ctaKind;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package ai.giskard.ml.dto;

import lombok.Getter;
import lombok.Setter;

import javax.annotation.Nullable;

@Getter
@Setter
public class MLWorkerWSGetPushResultDTO implements MLWorkerWSBaseDTO {
@Nullable
private MLWorkerWSPushDTO perturbation;
@Nullable
private MLWorkerWSPushDTO contribution;
@Nullable
private MLWorkerWSPushDTO borderline;
@Nullable
private MLWorkerWSPushDTO overconfidence;
@Nullable
private MLWorkerWSPushActionDTO action;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ai.giskard.ml.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class MLWorkerWSPushActionDTO implements MLWorkerWSBaseDTO {

@JsonProperty("object_uuid")
private String objectUuid;

private List<MLWorkerWSFuncArgumentDTO> arguments;
}
24 changes: 24 additions & 0 deletions backend/src/main/java/ai/giskard/ml/dto/MLWorkerWSPushDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ai.giskard.ml.dto;

import ai.giskard.domain.ml.PushKind;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import javax.annotation.Nullable;
import java.util.List;

@Getter
@Setter
public class MLWorkerWSPushDTO implements MLWorkerWSBaseDTO {
private PushKind kind;
@Nullable
private String key;
@Nullable
private String value;
@JsonProperty("push_title")
private String pushTitle;

@JsonProperty("push_details")
private List<MLWorkerWSPushDetailsDTO> pushDetails;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ai.giskard.ml.dto;

import ai.giskard.domain.ml.CallToActionKind;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class MLWorkerWSPushDetailsDTO implements MLWorkerWSBaseDTO {
private String action;
private String explanation;
private String button;
private CallToActionKind cta;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
@NoRepositoryBean
public interface CallableRepository<E extends Callable> extends MappableJpaRepository<E, UUID> {

int countByNameAndModule(String name, String module);
int countByDisplayName(String displayName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ai.giskard.web.dto.SlicingFunctionDTO;
import ai.giskard.web.dto.mapper.GiskardMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.logging.log4j.util.Strings;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand Down Expand Up @@ -42,10 +43,16 @@ public SlicingFunctionDTO save(SlicingFunctionDTO slicingFunction) {
protected SlicingFunction create(SlicingFunctionDTO dto) {
SlicingFunction function = giskardMapper.fromDTO(dto);
function.setProjectKey(dto.getProjectKey());

if (function.getArgs() != null) {
function.getArgs().forEach(arg -> arg.setFunction(function));
}
function.setVersion(slicingFunctionRepository.countByNameAndModule(function.getName(), function.getModule()) + 1);

if (Strings.isBlank(function.getDisplayName())) {
function.setDisplayName(function.getModule() + "." + function.getName());
}

function.setVersion(slicingFunctionRepository.countByDisplayName(function.getDisplayName()) + 1);
return function;
}

Expand Down Expand Up @@ -82,7 +89,7 @@ public SlicingFunctionDTO generate(List<ComparisonClauseDTO> comparisonClauses)
slicingFunction.setModuleDoc("");
slicingFunction.setName(name);
slicingFunction.setTags(List.of("pickle", "ui"));
slicingFunction.setVersion(slicingFunctionRepository.countByNameAndModule(slicingFunction.getName(), slicingFunction.getModule()) + 1);
slicingFunction.setVersion(slicingFunctionRepository.countByDisplayName(name) + 1);
slicingFunction.setCellLevel(false);
slicingFunction.setColumnType("");
slicingFunction.setProcessType(DatasetProcessFunctionType.CLAUSES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ai.giskard.repository.ml.TestFunctionRepository;
import ai.giskard.web.dto.TestFunctionDTO;
import ai.giskard.web.dto.mapper.GiskardMapper;
import org.apache.logging.log4j.util.Strings;
import org.springframework.stereotype.Service;

@Service
Expand All @@ -29,7 +30,13 @@ protected TestFunction create(TestFunctionDTO dto) {
if (function.getArgs() != null) {
function.getArgs().forEach(arg -> arg.setFunction(function));
}
function.setVersion(testFunctionRepository.countByNameAndModule(function.getName(), function.getModule()) + 1);

if (Strings.isBlank(function.getDisplayName())) {
function.setDisplayName(function.getModule() + "." + function.getName());
}

function.setVersion(testFunctionRepository.countByDisplayName(function.getDisplayName()) + 1);

return function;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ai.giskard.repository.ml.TransformationFunctionRepository;
import ai.giskard.web.dto.TransformationFunctionDTO;
import ai.giskard.web.dto.mapper.GiskardMapper;
import org.apache.logging.log4j.util.Strings;
import org.springframework.stereotype.Service;

@Service
Expand All @@ -29,7 +30,13 @@ protected TransformationFunction create(TransformationFunctionDTO dto) {
if (function.getArgs() != null) {
function.getArgs().forEach(arg -> arg.setFunction(function));
}
function.setVersion(transformationFunctionRepository.countByNameAndModule(function.getName(), function.getModule()) + 1);

if (Strings.isBlank(function.getDisplayName())) {
function.setDisplayName(function.getModule() + "." + function.getName());
}

function.setVersion(transformationFunctionRepository.countByDisplayName(function.getDisplayName()) + 1);

return function;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public MLWorkerWSBaseDTO performAction(MLWorkerID workerID, MLWorkerWSAction act
case ECHO -> parseReplyDTO(result, MLWorkerWSEchoMsgDTO.class);
case GENERATE_TEST_SUITE -> parseReplyDTO(result, MLWorkerWSGenerateTestSuiteDTO.class);
case GET_CATALOG -> parseReplyDTO(result, MLWorkerWSCatalogDTO.class);
case GET_PUSH -> parseReplyDTO(result, MLWorkerWSGetPushResultDTO.class);
};
} catch (JsonProcessingException e) {
return parseReplyErrorDTO(result);
Expand Down
24 changes: 24 additions & 0 deletions backend/src/main/java/ai/giskard/web/dto/ApplyPushDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ai.giskard.web.dto;

import ai.giskard.domain.ml.CallToActionKind;
import ai.giskard.domain.ml.PushKind;
import com.dataiku.j2ts.annotations.UIModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Map;
import java.util.UUID;

@Getter
@Setter
@UIModel
@NoArgsConstructor
public class ApplyPushDTO {
private UUID modelId;
private UUID datasetId;
private int rowIdx;
private PushKind pushKind;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since PushKind and CallToActionKind is a MLWorker generated type we have any type in ts due to missing translation. @andreybavt do you think there is a quick fix or we can keep like this.

private CallToActionKind ctaKind;
private Map<String, String> features;
}
17 changes: 17 additions & 0 deletions backend/src/main/java/ai/giskard/web/dto/PushActionDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ai.giskard.web.dto;

import com.dataiku.j2ts.annotations.UIModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Map;

@Getter
@Setter
@UIModel
@NoArgsConstructor
public class PushActionDTO {
private String objectUuid;
private Map<String, String> parameters;
}
Loading