Skip to content

Commit

Permalink
🧹 Allow printing data queries without an assessment (#4693)
Browse files Browse the repository at this point in the history
Boolean data queries will have an assessment. When we display them as
data queries, we do not want an assessment
  • Loading branch information
jaym authored Sep 25, 2024
1 parent fc20edb commit 78405c5
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions cli/printer/mql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ import (
"golang.org/x/exp/slices"
)

// Results prints a full query with all data points
// NOTE: ensure that results only contains results that match the bundle!
func (print *Printer) Results(bundle *llx.CodeBundle, results map[string]*llx.RawResult) string {
assessment := llx.Results2Assessment(bundle, results)

if assessment != nil {
return print.Assessment(bundle, assessment)
}

func (print *Printer) Datas(bundle *llx.CodeBundle, results map[string]*llx.RawResult) string {
var res strings.Builder
i := 0
for _, v := range results {
Expand All @@ -38,6 +30,18 @@ func (print *Printer) Results(bundle *llx.CodeBundle, results map[string]*llx.Ra
return res.String()
}

// Results prints a full query with all data points
// NOTE: ensure that results only contains results that match the bundle!
func (print *Printer) Results(bundle *llx.CodeBundle, results map[string]*llx.RawResult) string {
assessment := llx.Results2Assessment(bundle, results)

if assessment != nil {
return print.Assessment(bundle, assessment)
}

return print.Datas(bundle, results)
}

// Assessment prints a complete comparable assessment
func (print *Printer) Assessment(bundle *llx.CodeBundle, assessment *llx.Assessment) string {
var res strings.Builder
Expand Down

0 comments on commit 78405c5

Please sign in to comment.