Skip to content

Commit 19ef1b5

Browse files
committed
remove mock data
1 parent 3f29c83 commit 19ef1b5

3 files changed

Lines changed: 2 additions & 209 deletions

File tree

go/cmd/dashboard.go

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,16 @@
11
package cmd
22

33
import (
4-
"fmt"
5-
64
"github.com/spf13/cobra"
75

8-
"github.com/soda-data-inc/soda-cli/internal/mock"
96
"github.com/soda-data-inc/soda-cli/internal/output"
107
)
118

129
var dashboardCmd = &cobra.Command{
1310
Use: "dashboard",
1411
Short: "Org-level data quality overview",
1512
RunE: func(cmd *cobra.Command, args []string) error {
16-
d := mock.DashboardSummary
17-
18-
if output.EffectiveFmt(GCtx) == "json" {
19-
output.Render([]map[string]string{d}, []string{
20-
"organization", "profile", "datasources", "datasets",
21-
"passing_datasets", "failing_datasets", "open_incidents", "jobs_today",
22-
}, nil, GCtx)
23-
return nil
24-
}
25-
26-
fmt.Printf(" %-22s %s\n", output.Bold.Render("Organization"), d["organization"])
27-
fmt.Printf(" %-22s %s\n", output.Bold.Render("Profile"), d["profile"])
28-
fmt.Println()
29-
fmt.Printf(" %-22s %s\n", "Datasources", d["datasources"])
30-
fmt.Printf(" %-22s %s\n", "Datasets", d["datasets"])
31-
fmt.Printf(" %-22s %s / %s failing\n",
32-
"Dataset health",
33-
output.Green.Render(d["passing_datasets"]+" passing"),
34-
output.Red.Render(d["failing_datasets"]),
35-
)
36-
fmt.Printf(" %-22s %s\n", "Open incidents", output.Red.Render(d["open_incidents"]))
37-
fmt.Printf(" %-22s %s\n", "Jobs today", d["jobs_today"])
38-
return nil
13+
return output.Errorf(2, "dashboard is not yet available in the public API")
3914
},
4015
}
4116

go/cmd/job.go

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/soda-data-inc/soda-cli/internal/mock"
98
"github.com/soda-data-inc/soda-cli/internal/output"
109
)
1110

@@ -19,32 +18,7 @@ var jobListCmd = &cobra.Command{
1918
Use: "list",
2019
Short: "List recent jobs",
2120
RunE: func(cmd *cobra.Command, args []string) error {
22-
datasource, _ := cmd.Flags().GetString("datasource")
23-
dataset, _ := cmd.Flags().GetString("dataset")
24-
jobType, _ := cmd.Flags().GetString("type")
25-
status, _ := cmd.Flags().GetString("status")
26-
27-
rows := mock.Jobs
28-
filtered := []map[string]string{}
29-
for _, j := range rows {
30-
if datasource != "" && j["datasource"] != datasource {
31-
continue
32-
}
33-
if dataset != "" && j["dataset"] != dataset {
34-
continue
35-
}
36-
if jobType != "" && jobType != "all" && j["type"] != jobType {
37-
continue
38-
}
39-
if status != "" && j["status"] != status {
40-
continue
41-
}
42-
filtered = append(filtered, j)
43-
}
44-
45-
cols := []string{"id", "datasource", "dataset", "type", "status", "date"}
46-
output.Render(filtered, cols, map[string]bool{"status": true}, GCtx)
47-
return nil
21+
return output.Errorf(2, "job list is not yet available in the public API")
4822
},
4923
}
5024

@@ -113,11 +87,6 @@ var jobCancelCmd = &cobra.Command{
11387
}
11488

11589
func init() {
116-
jobListCmd.Flags().String("datasource", "", "Filter by datasource ID")
117-
jobListCmd.Flags().String("dataset", "", "Filter by dataset ID")
118-
jobListCmd.Flags().String("type", "all", "Filter by type: contract|monitor|all")
119-
jobListCmd.Flags().String("status", "", "Filter by status: passing|failing|running|error")
120-
12190
jobLogsCmd.Flags().Bool("follow", false, "Stream logs as they arrive")
12291

12392
jobCmd.AddCommand(jobListCmd, jobLogsCmd, jobCancelCmd)

go/internal/mock/mock.go

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)