Skip to content

Commit

Permalink
Remove prediction id column
Browse files Browse the repository at this point in the history
  • Loading branch information
khorshuheng committed Feb 28, 2024
1 parent df7cbf5 commit dfb7462
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 247 deletions.
120 changes: 47 additions & 73 deletions api/api/model_schema_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ func TestModelSchemaController_GetAllSchemas(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand All @@ -56,9 +55,8 @@ func TestModelSchemaController_GetAllSchemas(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(2),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand All @@ -82,9 +80,8 @@ func TestModelSchemaController_GetAllSchemas(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand All @@ -105,9 +102,8 @@ func TestModelSchemaController_GetAllSchemas(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(2),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand Down Expand Up @@ -187,7 +183,6 @@ func TestModelSchemaController_GetSchema(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(2),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand All @@ -212,7 +207,6 @@ func TestModelSchemaController_GetSchema(t *testing.T) {
ModelID: models.ID(1),
ID: models.ID(2),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Boolean,
Expand Down Expand Up @@ -292,7 +286,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand All @@ -313,10 +306,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
mockSvc.On("Save", mock.Anything, &models.ModelSchema{
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -334,10 +326,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -360,10 +351,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -387,7 +377,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand All @@ -409,10 +398,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
mockSvc.On("Save", mock.Anything, &models.ModelSchema{
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -430,10 +418,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -456,10 +443,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -483,7 +469,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand All @@ -507,10 +492,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
mockSvc.On("Save", mock.Anything, &models.ModelSchema{
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -531,10 +515,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -560,10 +543,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -590,7 +572,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand All @@ -611,10 +592,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
mockSvc.On("Save", mock.Anything, &models.ModelSchema{
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -632,10 +612,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -658,10 +637,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
ID: models.ID(1),
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand All @@ -685,7 +663,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand All @@ -706,10 +683,9 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
mockSvc.On("Save", mock.Anything, &models.ModelSchema{
ModelID: models.ID(1),
Spec: &models.SchemaSpec{
PredictionIDColumn: "prediction_id",
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
SessionIDColumn: "session_id",
RowIDColumn: "row_id",
TagColumns: []string{"tags"},
FeatureTypes: map[string]models.ValueType{
"featureA": models.Float64,
"featureB": models.Int64,
Expand Down Expand Up @@ -738,7 +714,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {
},
body: []byte(`{
"spec": {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand Down Expand Up @@ -788,7 +763,6 @@ func TestModelSchemaController_CreateOrUpdateSchema(t *testing.T) {

func Benchmark_Unmarshal(b *testing.B) {
data := []byte(` {
"prediction_id_column":"prediction_id",
"session_id_column":"session_id",
"row_id_column":"row_id",
"tag_columns": ["tags"],
Expand Down
Loading

0 comments on commit dfb7462

Please sign in to comment.