Expressions: expose ConvertDataFramesToResults (#83805)

This commit is contained in:
Ryan McKinley
2024-03-04 08:22:56 -08:00
committed by GitHub
parent 9bd84b30e9
commit 3036b50df3
13 changed files with 545 additions and 483 deletions

View File

@ -19,12 +19,11 @@ import (
type SQLCommand struct {
query string
varsToQuery []string
timeRange TimeRange
refID string
}
// NewSQLCommand creates a new SQLCommand.
func NewSQLCommand(refID, rawSQL string, tr TimeRange) (*SQLCommand, error) {
func NewSQLCommand(refID, rawSQL string) (*SQLCommand, error) {
if rawSQL == "" {
return nil, errutil.BadRequest("sql-missing-query",
errutil.WithPublicMessage("missing SQL query"))
@ -39,7 +38,6 @@ func NewSQLCommand(refID, rawSQL string, tr TimeRange) (*SQLCommand, error) {
return &SQLCommand{
query: rawSQL,
varsToQuery: tables,
timeRange: tr,
refID: refID,
}, nil
}
@ -59,7 +57,7 @@ func UnmarshalSQLCommand(rn *rawNode) (*SQLCommand, error) {
return nil, fmt.Errorf("expected sql expression to be type string, but got type %T", expressionRaw)
}
return NewSQLCommand(rn.RefID, expression, rn.TimeRange)
return NewSQLCommand(rn.RefID, expression)
}
// NeedsVars returns the variable names (refIds) that are dependencies